1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-08-15 16:21:07 +02:00

27492 based on Jörg Sommer: 27473: fix run-help alias problem.

This commit is contained in:
Peter Stephenson 2009-12-16 11:07:09 +00:00
parent c4b72029cd
commit 46bad169a8
2 changed files with 14 additions and 4 deletions
ChangeLog
Functions/Misc

View file

@ -1,3 +1,8 @@
2009-12-16 Peter Stephenson <pws@csr.com>
* 27492 based on Jörg Sommer: 27473: Functions/Misc/run-help:
fix alias problem.
2009-12-14 Peter Stephenson <p.w.stephenson@ntlworld.com> 2009-12-14 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 27518: Completion/Unix/Command/_configure: suggest some * 27518: Completion/Unix/Command/_configure: suggest some
@ -12492,5 +12497,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.4843 $ * $Revision: 1.4844 $
***************************************************** *****************************************************

View file

@ -49,6 +49,7 @@ if [[ $places = *"not found"* && $1 != ${(Q)1} ]]; then
noalias=1 noalias=1
fi fi
{
while ((i++ < $#places)) while ((i++ < $#places))
do do
what=$places[$i] what=$places[$i]
@ -56,7 +57,8 @@ do
builtin print -r $what builtin print -r $what
case $what in case $what in
(*( is an alias)*) (*( is an alias)*)
[[ ${what[(w)6]:t} != ${what[(w)1]} ]] && run-help ${what[(w)6]:t} [[ ${what[(w)6]:t} != ${what[(w)1]} ]] &&
run_help_orig_cmd=${what[(w)1]} run-help ${what[(w)6]:t}
;; ;;
(*( is a * function)) (*( is a * function))
case ${what[(w)1]} in case ${what[(w)1]} in
@ -96,9 +98,9 @@ do
builtin print -z "$cmd_args" builtin print -z "$cmd_args"
cmd_args=( ${(z)cmd_args} ) cmd_args=( ${(z)cmd_args} )
# Discard environment assignments, etc. # Discard environment assignments, etc.
while [[ $cmd_args[1] != $1 ]] while [[ $cmd_args[1] != ${run_help_orig_cmd:-$1} ]]
do do
shift cmd_args shift cmd_args || return 1
done done
eval "run-help-$1:t ${(q@)cmd_args[2,-1]}" eval "run-help-$1:t ${(q@)cmd_args[2,-1]}"
else else
@ -115,3 +117,6 @@ do
[[ $what == [qQ] ]] && break [[ $what == [qQ] ]] && break
fi fi
done done
} always {
unset run_help_orig_cmd
}