about summary refs log tree commit diff
diff options
context:
space:
mode:
-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