diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/unpack200 | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-3f3e0627fa0e1521391adec3d037f6f57772c8a1.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/unpack200')
-rw-r--r-- | completions/unpack200 | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/completions/unpack200 b/completions/unpack200 index 393df04d..8814259b 100644 --- a/completions/unpack200 +++ b/completions/unpack200 @@ -6,15 +6,15 @@ _unpack200() _init_completion -s || return case $prev in - --help|--version|-!(-*)[?hVJ]) + --help | --version | -!(-*)[?hVJ]) return ;; - --deflate-hint|-!(-*)H) - COMPREPLY=( $(compgen -W 'true false keep' -- "$cur") ) + --deflate-hint | -!(-*)H) + COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) return ;; - --log-file|-!(-*)l) - COMPREPLY=( $(compgen -W '-' -- "$cur") ) + --log-file | -!(-*)l) + COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir log return ;; @@ -23,26 +23,26 @@ _unpack200() $split && return # Check if a pack or a jar was already given. - local i pack=false jar=false - for (( i=0; i < ${#words[@]}-1; i++ )) ; do - case ${words[i]} in - *.pack|*.pack.gz) pack=true ;; + local word pack=false jar=false + for word in "${words[@]:1}"; do + case $word in + *.pack | *.pack.gz) pack=true ;; *.jar) jar=true ;; esac done - if ! $pack ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--deflate-hint= --remove-pack-file - --verbose --quiet --log-file= --help --version' -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if ! $pack; then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--deflate-hint= --remove-pack-file + --verbose --quiet --log-file= --help --version' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir 'pack?(.gz)' fi - elif ! $jar ; then + elif ! $jar; then _filedir jar fi } && -complete -F _unpack200 unpack200 + complete -F _unpack200 unpack200 # ex: filetype=sh |