mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-01 08:21:17 +02:00
users/9604: enhance run-help to strip quotes
This commit is contained in:
parent
f42d15278d
commit
2b281e741c
@ -1,5 +1,8 @@
|
||||
2005-11-01 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* users/9604: Functions/Misc/run-help: enhanced to strip quotes
|
||||
from argument if necessary.
|
||||
|
||||
* 21967 (docmentation tweaked): Doc/Zsh/expn.yo, Src/subst.c:
|
||||
${(#)foo} uses matheval to produce characters.
|
||||
|
||||
|
@ -33,15 +33,22 @@ then
|
||||
fi
|
||||
|
||||
# No zsh help; use "whence" to figure out where else we might look
|
||||
local what places newline='
|
||||
local what places noalias newline='
|
||||
'
|
||||
integer i=0 didman=0
|
||||
|
||||
places=( "${(@f)$(builtin whence -va $1)}" )
|
||||
if [[ $places = *"not found"* && $1 != ${(Q)1} ]]; then
|
||||
# Different when unquoted, so try stripping quotes.
|
||||
places=( "${(@f)$(builtin whence -va ${(Q)1})}" )
|
||||
# Quotation is significant to aliases, so suppress lookup.
|
||||
noalias=1
|
||||
fi
|
||||
|
||||
while ((i++ < $#places))
|
||||
do
|
||||
what=$places[$i]
|
||||
[[ -n $noalias && $what = *" is an alias "* ]] && continue
|
||||
builtin print -r $what
|
||||
case $what in
|
||||
(*( is an alias)*)
|
||||
|
Loading…
Reference in New Issue
Block a user