1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

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

This commit is contained in:
Clint Adams 2000-04-14 15:42:10 +00:00
parent 0abbba01c3
commit 336542eba2
2 changed files with 29 additions and 9 deletions

View file

@ -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>

View file

@ -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))