diff options
Diffstat (limited to 'contrib/postfix')
-rw-r--r-- | contrib/postfix | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/contrib/postfix b/contrib/postfix index dccdc1e5..ec91c1a3 100644 --- a/contrib/postfix +++ b/contrib/postfix @@ -8,8 +8,7 @@ _postfix() local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -30,7 +29,7 @@ _postfix() COMPREPLY=( $( compgen -W 'check start stop abort flush reload status \ set-permissions upgrade-configuration' -- "$cur" ) ) } -complete -F _postfix $filenames postfix +complete -F _postfix -o filenames postfix # postalias(1) and postmap(1) # @@ -39,8 +38,7 @@ _postmap() local cur prev len idx COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -75,7 +73,7 @@ _postmap() fi return 0 } -complete -F _postmap $filenames postmap postalias +complete -F _postmap -o filenames postmap postalias # postcat(1) # @@ -84,8 +82,7 @@ _postcat() local cur prev pval len idx qfile COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -107,7 +104,7 @@ _postcat() len=${#cur} idx=0 for pval in $( mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -119,7 +116,7 @@ _postcat() return 0 fi } -complete -F _postcat $filenames postcat +complete -F _postcat -o filenames postcat # postconf(1) # @@ -128,8 +125,7 @@ _postconf() local cur prev pval len idx eqext COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -b|-t) @@ -162,7 +158,7 @@ _postconf() done return 0 } -complete -F _postconf $filenames postconf +complete -F _postconf -o filenames postconf # postsuper(1) # @@ -171,8 +167,7 @@ _postsuper() local cur prev pval len idx COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -182,8 +177,8 @@ _postsuper() -[dr]) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -194,8 +189,8 @@ _postsuper() -h) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//; /!$/d' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -206,8 +201,8 @@ _postsuper() -H) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -224,7 +219,7 @@ _postsuper() COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) ) } -complete -F _postsuper $filenames postsuper +complete -F _postsuper -o filenames postsuper } # Local variables: |