summaryrefslogtreecommitdiff
path: root/Functions/Misc/run-help
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 /Functions/Misc/run-help
parent0abbba01c3b1c051b6847fb6ef7e74ef82be18a7 (diff)
downloadzsh-336542eba2f788db86e06801ae654859f131ae0d.tar.gz
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
Diffstat (limited to 'Functions/Misc/run-help')
-rw-r--r--Functions/Misc/run-help34
1 files changed, 25 insertions, 9 deletions
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))