diff options
Diffstat (limited to 'completions/postmap')
-rw-r--r-- | completions/postmap | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/completions/postmap b/completions/postmap index 1b415f69..66756c1e 100644 --- a/completions/postmap +++ b/completions/postmap @@ -16,24 +16,23 @@ _postmap() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi if [[ "$cur" == *:* ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -f -- "${cur#*:}") ) else - local len=${#cur} idx=0 pval - for pval in $( /usr/sbin/postconf -m 2>/dev/null ); do + local len=${#cur} pval + for pval in $(/usr/sbin/postconf -m 2>/dev/null); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]="$pval:" - idx=$(($idx+1)) + COMPREPLY+=( "$pval:" ) fi done - if [[ $idx -eq 0 ]]; then + if [[ ! $COMPREPLY ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "$cur" ) ) + COMPREPLY=( $(compgen -f -- "$cur") ) fi fi } && |