about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-04-14 15:42:10 +0000
committerClint Adams <clint@users.sourceforge.net>2000-04-14 15:42:10 +0000
commit336542eba2f788db86e06801ae654859f131ae0d (patch)
tree080281fda33653538442da2bc06706b2c8671849
parent0abbba01c3b1c051b6847fb6ef7e74ef82be18a7 (diff)
downloadzsh-336542eba2f788db86e06801ae654859f131ae0d.tar.gz
zsh-336542eba2f788db86e06801ae654859f131ae0d.tar.xz
zsh-336542eba2f788db86e06801ae654859f131ae0d.zip
10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements10764: run-help improvements
-rw-r--r--ChangeLog4
-rw-r--r--Functions/Misc/run-help34
2 files changed, 29 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b452f3e9..b9f7c3598 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2000-04-14  Clint Adams  <schizo@debian.org>
 
+	* 10764: Radim Kolar: Functions/Misc/run-help: support
+	for reserved words and multiple arguments being passed
+	on to man.
+
 	* 10763: Completion/Builtins/_vars_eq: complete after :
 
 2000-04-14  Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help
index a8109e3ea..4f447b9f0 100644
--- a/Functions/Misc/run-help
+++ b/Functions/Misc/run-help
@@ -11,16 +11,19 @@
 emulate -R zsh
 setopt localoptions
 
+[[ $1 == "." ]] && 1="dot"
+[[ $1 == ":" ]] && 1="colon"
+
 # Check whether Util/helpfiles has been used to generate zsh help
-if [[ $1 == "-l" ]]
+if [[ $# == 0 || $1 == "-l" ]]
 then
-    if [[ -n "${HELPDIR:-}" ]]
+    if [[ -n "${HELPDIR:-}" && -d $HELPDIR ]]
     then
-	echo 'Here is a list of topics for which help is available:'
+	echo "Here is a list of topics for which special help is available:"
 	echo ""
 	print -rc $HELPDIR/*(:t)
     else
-	echo 'There is no list of help topics available at this time'
+	echo "There is no list of special help topics available at this time."
     fi
     return 0
 elif [[ -n "${HELPDIR:-}" && -r $HELPDIR/$1 && $1 != compctl ]]
@@ -29,7 +32,7 @@ then
     return $?
 fi
 
-# No zsh help, use "whence" to figure out where else we might look
+# No zsh help; use "whence" to figure out where else we might look
 local what places newline='
 '
 integer i=0 didman=0
@@ -45,21 +48,34 @@ do
 	[[ ${what[(w)6]:t} != ${what[(w)1]} ]] && run-help ${what[(w)6]:t}
 	;;
     (*( is a * function))
-	builtin functions ${what[(w)1]} | ${=PAGER:-more}
-	;;
+	case ${what[(w)1]} in
+	(comp*) man zshcompsys;;
+	(zf*) man zshftpsys;;
+	(*) builtin functions ${what[(w)1]} | ${=PAGER:-more};;
+	esac;;
     (*( is a * builtin))
 	case ${what[(w)1]} in
 	(compctl) man zshcompctl;;
-	(bindkey) man zshzle;;
+	(comp*) man zshcompwid;;
+	(bindkey|vared|zle) man zshzle;;
 	(*setopt) man zshoptions;;
+	(cap|getcap|setcap) ;&
+	(clone) ;&
+	(ln|mkdir|mv|rm|rmdir|sync) ;&
+	(sched) ;&
+	(stat) man zshmodules;;
+	(zftp) man zshftpsys;;
 	(*) man zshbuiltins;;
 	esac
 	;;
     (*( is hashed to *))
 	man ${what[(w)-1]:t}
 	;;
+    (*( is a reserved word))
+	man zshmisc
+	;;
     (*)
-	((! didman++)) && man $1
+	((! didman++)) && man $@
 	;;
     esac
     if ((i < $#places && ! didman))