diff options
Diffstat (limited to 'completions/postsuper')
-rw-r--r-- | completions/postsuper | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/completions/postsuper b/completions/postsuper index e69cbea0..509d2484 100644 --- a/completions/postsuper +++ b/completions/postsuper @@ -5,7 +5,7 @@ _postsuper() local cur prev words cword _init_completion || return - local pval len idx + local pval len case $prev in -c) @@ -14,36 +14,30 @@ _postsuper() ;; -[dr]) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return ;; -h) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return ;; -H) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command 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)) + COMPREPLY+=( $pval ) fi done return @@ -51,11 +45,11 @@ _postsuper() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'hold incoming active deferred' -- "$cur") ) } && complete -F _postsuper postsuper |