X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=docs%2FCOMPLETION-BASH;h=da20671828b832a708c19d7f710b5bbd75751dd6;hp=b5bdfbc4246ffe5b20b7206e98e796502d030f27;hb=32b2354dbaf4bf934936eb5b102a4a3d2fdd209a;hpb=5dcf161b0c2cc885e4dfa23fe4b4e1ab47e139c6 diff --git a/docs/COMPLETION-BASH b/docs/COMPLETION-BASH index b5bdfbc..da20671 100644 --- a/docs/COMPLETION-BASH +++ b/docs/COMPLETION-BASH @@ -2,6 +2,9 @@ # Copyright 2003 "Wade Richards" # Permission granted to redistribute under the BSD license +[ "$BASH_COMPLETION" ] || echo "ERROR: COMPLETION-BASH is not intended to be \ +sourced directly, but rather added to a bash-completion package installation." + have show && _nmh() { @@ -13,7 +16,7 @@ _nmh() prev=${COMP_WORDS[COMP_CWORD-1]} command=$1 - orig_opts=$(shopt -p extglob) + orig_opts=$(shopt -p extglob) shopt -s extglob # Get the folder, if specified @@ -21,110 +24,94 @@ _nmh() do case "${COMP_WORDS[i]}" in \++([a-zA-Z_]) ) - folder=${COMP_WORDS[i]} + folder=${COMP_WORDS[i]} origfolder=$( folder -f ) ;; esac done - case $current in - -* ) + case $current in + -* ) # Command-line switches for the most common commands. case $command in - ali ) + ali ) # no sequences or messages options=(-alias -list -nolist -normalize -nonormalize -user - -nouser -version -help) + -nouser -Version -help) ;; - burst ) + burst ) options=(-inplace -noinplace -quiet -noquiet -verbose - -noverbose -version -help) + -noverbose -Version -help) ;; comp ) - options=(-form -use -nouse -file -draftfolder -draftmessage - -nodraftfolder -editor -noedit -whatnowproc -nowhatnowproc - -version -help ) - ;; + options=(-form -use -nouse + -editor -noedit -whatnowproc + -Version -help ) + ;; flist* ) options=(-sequence -all -noall -showzero -noshowzero - -recurse -norecurse -fast -nofast -alpha -noalpha -version + -recurse -norecurse -fast -nofast -alpha -noalpha -Version -help) ;; folder* ) options=(-all -noall -create -nocreate -fast -nofast -header -noheader -recurse -norecurse -total -nototal -list -nolist - -push -pop -pack -nopack -print -verbose -noverbose -version - -help) + -push -pop -pack -nopack -print -verbose -noverbose + -Version -help) ;; forw ) - options=(-annotate -noannotate -form -format -noformat - -filter -inplace -noinplace -mime -nomime -draftfolder - -draftmessage -nodraftfolder -editor -noedit -whatnowproc - -nowhatnowproc -dashstuffing -nodashstuffing -build -file - -version -help) + options=(-annotate -noannotate -form + -editor -noedit -whatnowproc -build + -Version -help) ;; inc ) - options=(-audit -noaudit -changecur -nochangecur -form -format - -file -silent -nosilent -truncate -notruncate -width -host - -user -pack -nopack -apop -noapop -kpop -sasl -saslmech -snoop - -version -help) + options=(-audit -noaudit -changecur -nochangecur -form + -file -silent -nosilent -truncate -notruncate -width + -Version -help) ;; mark ) options=(-sequence -add -delete -list -public -nopublic - -zero -nozero -version -help) - ;; - next ) - options=(-showmimeproc -header -noheader -checkmime - -nocheckmime -version -help) + -zero -nozero -Version -help) ;; packf ) - options=(-file -mbox -mmdf -version -help) + options=(-file -Version -help) ;; pick ) options=(-and -or -not -lbrace -rbrace --component -cc -date -from -search -subject -to -after -before -datefield -sequence -public -nopublic -zero -nozero -list -nolist - -version -help) - ;; - prev ) - options=(-showproc -showmimeproc -header -noheader -checkmime - -nocheckmime -version -help) + -Version -help) ;; refile ) - options=(-draft -link -nolink -preserve -nopreserve -unlink - -nounlink -src -file -rmmproc -normmproc -version -help) + options=(-link -nolink -src -file -Version -help) ;; repl ) options=(-annotate -noannotate -group -nogroup -cc - -nocc -query -noquery -form -format -noformat -filter - -inplace -noinplace -mime -nomime -fcc -width -draftfolder - -draftmessage -nodraftfolder -editor -noedit -whatnowproc - -nowhatnowproc -build -file -version -help) + -nocc -query -noquery -form -filter -nofilter + -mime -nomime -editor -noedit -whatnowproc + -build -file -Version -help) ;; rmf ) - options=(-interactive -nointeractive -version -help) + options=(-interactive -nointeractive -Version -help) ;; rmm ) - options=(-link -nolink -version -help) + options=(-link -nolink -Version -help) ;; scan ) - options=(-clear -noclear -form -format -header -noheader - -width -reverse -noreverse -file -version -help ) + options=(-form -header -noheader + -width -file -Version -help ) ;; show ) - options=(-draft -showproc -showmimeproc -header -noheader - -checkmime -nocheckmime -version -help) + next ) + prev ) + options=(-file -part -type -form -Version -help) ;; sortm ) options=(-datefield -textfield -notextfield -limit -nolimit - -verbose -noverbose -version -help) - ;; - whom ) - options=(-alias -check -nocheck -draft -draftfolder - -draftmessage -nodraftfolder -version -help) + -verbose -noverbose -Version -help) ;; * ) - options=(-help -version -seq) + options=(-help -Version -seq) ;; esac ;; @@ -137,13 +124,13 @@ _nmh() +([0-9a-z])-* ) # Partial range start=${current/%-*/} - options=( $( scan $folder -format "%(msg)" "${start}-last" ) first prev cur next last ) + options=( $( scan $folder -form "=%(msg)" "${start}-last" ) first prev cur next last ) options=( ${options[@]//#/${start}-} ) ;; +([0-9]) ) # Message number, or start of range - options=( $( scan $folder -format "%(msg)" ) first prev cur next last ) + options=( $( scan $folder -form "=%(msg)" ) first prev cur next last ) options=( ${options[@]} ${options[@]//%/-} ) ;; @@ -162,4 +149,4 @@ _nmh() COMPREPLY=( $( compgen -W "${options[*]}" -- $current ) ) return 0 } -[ "$have" ] && complete -F _nmh ali anno burst comp dist flist flists folder folders forw inc mark mhbuild mhl mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk msh next packf pick prev prompter rcvdist rcvpack rcvstore rcvtty refile repl rmf rmm scan send sendfiles show slocal sortm whatnow whom +[ "$have" ] && complete -F _nmh ali anno burst comp dist flist flists folder folders forw inc mark mhbuild mhl mhlist mhmail mhparam mhpath mhstore msgchk next packf pick prev prompter rcvdist rcvpack rcvstore refile repl rmf rmm scan send sendfiles show slocal sortm whatnow