summaryrefslogtreecommitdiff
path: root/Functions/Misc/run-help
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Misc/run-help')
-rw-r--r--Functions/Misc/run-help12
1 files changed, 6 insertions, 6 deletions
diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help
index d52c1b032..462044b72 100644
--- a/Functions/Misc/run-help
+++ b/Functions/Misc/run-help
@@ -58,11 +58,11 @@ do
case $what in
(*( is an alias for (noglob|nocorrect))*)
[[ ${what[(w)7]:t} != ${what[(w)1]} ]] &&
- run_help_orig_cmd=${what[(w)1]} run-help ${what[(w)7]:t}
+ run_help_orig_cmd=${what[(w)1]} run-help ${what[(w)7]:t} ${(z)${what[(w)8,-1]}}
;;
(*( is an alias)*)
[[ ${what[(w)6]:t} != ${what[(w)1]} ]] &&
- run_help_orig_cmd=${what[(w)1]} run-help ${what[(w)6]:t}
+ run_help_orig_cmd=${what[(w)1]} run-help ${what[(w)6]:t} ${(z)${what[(w)7,-1]}}
;;
(*( is a * function))
case ${what[(w)1]} in
@@ -98,13 +98,13 @@ do
if whence "run-help-$1:t" >/dev/null
then
local cmd_args
- builtin getln cmd_args
+ builtin getln cmd_args &&
builtin print -z "$cmd_args"
- cmd_args=( ${(z)cmd_args} )
+ cmd_args=( ${(z)${cmd_args:-"$*"}} )
# Discard the command itself & everything before it.
- shift $cmd_args[(i)${run_help_orig_cmd:-$1}] cmd_args ||
- return
+ shift $cmd_args[(i)(${run_help_orig_cmd}|$1)] cmd_args 2>/dev/null ||
+ continue
# Discard options, parameter assignments & paths.
cmd_args=( ${cmd_args[@]:#([-+]*|*=*|*/*|\~*)} )