From 2b281e741cda86f0e7539214235139f372764696 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 1 Nov 2005 18:25:05 +0000 Subject: users/9604: enhance run-help to strip quotes --- Functions/Misc/run-help | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Functions/Misc') diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help index 4f447b9f0..7dd875842 100644 --- a/Functions/Misc/run-help +++ b/Functions/Misc/run-help @@ -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)*) -- cgit 1.4.1