From 8e029323a76b48cdbeeb03045e2fc6348e2b060b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 28 Jul 2016 18:01:36 +0000 Subject: unposted: Avoid $0 for POSIX_ARGZERO compatibility. --- Functions/Misc/add-zle-hook-widget | 4 ++-- Functions/Misc/add-zsh-hook | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Functions') 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 -- cgit 1.4.1