From 336542eba2f788db86e06801ae654859f131ae0d Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Fri, 14 Apr 2000 15:42:10 +0000 Subject: 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 --- ChangeLog | 4 ++++ Functions/Misc/run-help | 34 +++++++++++++++++++++++++--------- 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 + * 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 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)) -- cgit 1.4.1