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/gzip | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-95623d39d6029ba78ec96ad5ea08e9ac12629b91.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/gzip')
-rw-r--r-- | completions/gzip | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/completions/gzip b/completions/gzip index d3bce282..0144c3a3 100644 --- a/completions/gzip +++ b/completions/gzip @@ -6,38 +6,38 @@ _gzip() _init_completion || return case $prev in - --blocksize|--suffix|--help|--version|-!(-*)[bShV]) + --blocksize | --suffix | --help | --version | -!(-*)[bShV]) return ;; - --processes|-!(-*)p) - COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) + --processes | -!(-*)p) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local IFS=$'\n' xspec="*.@(gz|t[ag]z)" [[ ${1##*/} == pigz ]] && xspec="*.@([gz]z|t[ag]z)" - if [[ "$prev" == --* ]]; then - [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec - [[ "$prev" == --force ]] && xspec= - elif [[ "$prev" == -* ]]; then - [[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec - [[ "$prev" == -*f* ]] && xspec= + if [[ $prev == --* ]]; then + [[ $prev == --@(decompress|list|test) ]] && xspec="!"$xspec + [[ $prev == --force ]] && xspec= + elif [[ $prev == -* ]]; then + [[ $prev == -*[dlt]* ]] && xspec="!"$xspec + [[ $prev == -*f* ]] && xspec= fi _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") \ - $(compgen -d -- "$cur") ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") + $(compgen -d -- "$cur")) } && -complete -F _gzip gzip pigz + complete -F _gzip gzip pigz # ex: filetype=sh |