about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-11-01 18:25:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-11-01 18:25:05 +0000
commit2b281e741cda86f0e7539214235139f372764696 (patch)
tree6d1b2eb21c4424efd2b5ee0d848cbc56bf200037
parentf42d15278dbdfa185b24e17f228be0c8c59a9c44 (diff)
downloadzsh-2b281e741cda86f0e7539214235139f372764696.tar.gz
zsh-2b281e741cda86f0e7539214235139f372764696.tar.xz
zsh-2b281e741cda86f0e7539214235139f372764696.zip
users/9604: enhance run-help to strip quotes
-rw-r--r--ChangeLog3
-rw-r--r--Functions/Misc/run-help9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d0e10d9c..e9f3e0149 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
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)*)