about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-28 18:01:36 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-28 18:07:57 +0000
commit8e029323a76b48cdbeeb03045e2fc6348e2b060b (patch)
treecf9cddddd5a8ff982f208ab3e5775297f8375f3c
parentb816bb42cfc4d0fa05abb63ebf4098af05a3d593 (diff)
downloadzsh-8e029323a76b48cdbeeb03045e2fc6348e2b060b.tar.gz
zsh-8e029323a76b48cdbeeb03045e2fc6348e2b060b.tar.xz
zsh-8e029323a76b48cdbeeb03045e2fc6348e2b060b.zip
unposted: Avoid $0 for POSIX_ARGZERO compatibility.
-rw-r--r--ChangeLog6
-rw-r--r--Functions/Misc/add-zle-hook-widget4
-rw-r--r--Functions/Misc/add-zsh-hook2
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d68cf75d..9153ff197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-28  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* unposted: Functions/Misc/add-zle-hook-widget,
+	Functions/Misc/add-zsh-hook: Avoid $0 for POSIX_ARGZERO
+	compatibility.
+
 2016-07-28  Oliver Kiddle  <opk@zsh.org>
 
 	* 38957: Functions/Zle/select-word-match,
diff --git a/Functions/Misc/add-zle-hook-widget b/Functions/Misc/add-zle-hook-widget
index 82a404d7a..c47d9a3cb 100644
--- a/Functions/Misc/add-zle-hook-widget
+++ b/Functions/Misc/add-zle-hook-widget
@@ -62,7 +62,7 @@ function add-zle-hook-widget {
     zstyle -a zle-hook types hooktypes
 
     # This part copied from add-zsh-hook
-    local usage="Usage: $0 hook widgetname\nValid hooks are:\n  $hooktypes"
+    local usage="Usage: $funcstack[1] hook widgetname\nValid hooks are:\n  $hooktypes"
 
     local opt
     local -a autoopts
@@ -130,7 +130,7 @@ function add-zle-hook-widget {
 	# Check whether attempting to add a widget named for the hook
 	if [[ "$fn" = "$hook" ]]; then
 	    if [[ -n "${widgets[$fn]}" ]]; then
-		print -u2 "${0}: Cannot hook $fn to itself"
+		print -u2 "$funcstack[1]: Cannot hook $fn to itself"
 		return 1
 	    fi
 	    # No point in building the array until another is added
diff --git a/Functions/Misc/add-zsh-hook b/Functions/Misc/add-zsh-hook
index fc39659ae..3bc952e2f 100644
--- a/Functions/Misc/add-zsh-hook
+++ b/Functions/Misc/add-zsh-hook
@@ -19,7 +19,7 @@ hooktypes=(
   chpwd precmd preexec periodic zshaddhistory zshexit
   zsh_directory_name
 )
-local usage="Usage: $0 hook function\nValid hooks are:\n  $hooktypes"
+local usage="Usage: add-zsh-hook hook function\nValid hooks are:\n  $hooktypes"
 
 local opt
 local -a autoopts