1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00

unposted: Avoid $0 for POSIX_ARGZERO compatibility.

This commit is contained in:
Daniel Shahaf 2016-07-28 18:01:36 +00:00
parent b816bb42cf
commit 8e029323a7
3 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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