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/ss | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-95623d39d6029ba78ec96ad5ea08e9ac12629b91.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/ss')
-rw-r--r-- | completions/ss | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/completions/ss b/completions/ss index 05e4e4b2..4a27d514 100644 --- a/completions/ss +++ b/completions/ss @@ -6,23 +6,24 @@ _ss() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --family|-!(-*)f) - COMPREPLY=( $(compgen -W 'unix inet inet6 link netlink' \ - -- "$cur") ) + --family | -!(-*)f) + COMPREPLY=($(compgen -W 'unix inet inet6 link netlink' \ + -- "$cur")) return ;; - --query|-!(-*)A) - local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $(compgen -W '$("$1" --help | \ + --query | -!(-*)A) + local prefix= + [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=($(compgen -W '$("$1" --help | \ command sed -e "s/|/ /g" -ne "s/.*QUERY := {\([^}]*\)}.*/\1/p")' \ - -- "${cur##*,}") ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) + -- "${cur##*,}")) + ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/#/$prefix}) return ;; - --diag|--filter|-!(-*)[DF]) + --diag | --filter | -!(-*)[DF]) _filedir return ;; @@ -31,10 +32,10 @@ _ss() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _ss ss + complete -F _ss ss # ex: filetype=sh |