mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-22 16:20:23 +02:00
24332, 24333: Improvements to run-help suggested by J.Sommer.
This commit is contained in:
parent
f77eaddddf
commit
66742c6045
6 changed files with 63 additions and 4 deletions
|
@ -85,7 +85,24 @@ do
|
|||
man zshmisc
|
||||
;;
|
||||
(*)
|
||||
((! didman++)) && man $@
|
||||
if ((! didman++))
|
||||
then
|
||||
if whence "run-help-$1:t" >/dev/null
|
||||
then
|
||||
local cmd_args
|
||||
builtin getln cmd_args
|
||||
builtin print -z "$cmd_args"
|
||||
cmd_args=( ${(z)cmd_args} )
|
||||
# Discard environment assignments, etc.
|
||||
while [[ $cmd_args[1] != $1 ]]
|
||||
do
|
||||
shift cmd_args
|
||||
done
|
||||
eval "run-help-$1:t ${(@)cmd_args[2,-1]}"
|
||||
else
|
||||
man $@:t
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if ((i < $#places && ! didman))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue