From 9867c4091e71e6ed69889a9bfaee07275d2fa04e Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 19 Aug 1999 11:18:05 +0000 Subject: manual/7448 --- Completion/User/_mh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'Completion/User/_mh') diff --git a/Completion/User/_mh b/Completion/User/_mh index f03e3d827..3a2e53794 100644 --- a/Completion/User/_mh +++ b/Completion/User/_mh @@ -8,7 +8,7 @@ local mymhdir=~/Mail local mhlib=/usr/lib/mh -local prev="$words[CURRENT-1]" +local prev="$words[CURRENT-1]" expl # To be on the safe side, check this exists and if not, get it anyway. [[ -d $mymhdir ]] || mymhdir=$(mhpath +) @@ -17,7 +17,8 @@ if compset -P 1 -; then # get list of options, which MH commands can generate themselves # awk is just too icky to use for this, sorry. send me one if # you come up with it. - compadd - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) { + _description expl option + compadd "$expl[@]" - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) { $n = $1; $n =~ s/\)//g; print $n =~ s/^\[([a-z]+)\]// ? "$n\n$1$n\n" : "$n\n"; @@ -35,9 +36,11 @@ elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then fi # painless, or what? - _path_files -W mhpath -/ + _description expl 'MH folder' + _path_files "$expl[@]" -W mhpath -/ elif [[ "$prev" = -(editor|(whatnow|rmm|show|more)proc) ]]; then - compgen -c + _description expl command + compgen "$expl[@]" -c elif [[ "$prev" = -file ]]; then _files elif [[ "$prev" = -(form|audit|filter) ]]; then @@ -48,11 +51,14 @@ elif [[ "$prev" = -(form|audit|filter) ]]; then [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; } mhfpath=($mymhdir $mhlib) - compgen -W mhfpath -g '*(.)' + _description expl 'MH template file' + compgen "$expl[@]" -W mhfpath -g '*(.)' elif [[ "$prev" = -(no|)cc ]]; then - compadd all to cc me + _description expl 'CC address' + compadd "$expl[@]" all to cc me elif [[ "$prev" = -[rw]cache ]]; then - compadd public private never ask + _description expl cache + compadd "$expl[@]" public private never ask else # Generate sequences. local foldnam folddir f ret @@ -69,10 +75,11 @@ else # leaving foldnam empty works here fi - compadd $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') && + _description expl sequence + compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') && ret=0 - compadd reply next cur prev first last all unseen && ret=0 - compgen -W folddir -g '<->' && ret=0 + compadd "$expl[@]" reply next cur prev first last all unseen && ret=0 + compgen "$expl[@]" -W folddir -g '<->' && ret=0 return ret fi -- cgit 1.4.1