diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:14 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:14 -0300 |
commit | cc81eb120ad1a456f030f7b828697013a9b2b66a (patch) | |
tree | bb61702f98b407b2f7987faa846190fb3f002e55 /completions/_adb | |
parent | 8394526300cc384e53c470303aeb8b4fdcaf84a3 (diff) | |
parent | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (diff) | |
download | bash-completion-cc81eb120ad1a456f030f7b828697013a9b2b66a.tar.gz |
Update upstream source from tag 'upstream/2.11'
Update to upstream version '2.11'
with Debian dir 932c2c1a6192441f3cd8897e72d737f2f0277f60
Diffstat (limited to 'completions/_adb')
-rw-r--r-- | completions/_adb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/completions/_adb b/completions/_adb index 52b2cb96..e8ebab13 100644 --- a/completions/_adb +++ b/completions/_adb @@ -5,9 +5,9 @@ _adb_command_usage() { - COMPREPLY=( $(compgen -W \ + COMPREPLY=($(compgen -W \ '$("$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ - | command sed -e "s/[]|[]/\n/g" | _parse_help -)' -- "$cur") ) + | command sed -e "s/[]|[]/\n/g" | _parse_help -)' -- "$cur")) } _adb() @@ -16,7 +16,7 @@ _adb() _init_completion || return case $prev in - -s|-p|--algo|--key|--iv) + -s | -p | --algo | --key | --iv) return ;; -f) @@ -26,23 +26,23 @@ _adb() esac local cmd i - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" != -* && "${words[i-1]}" != -[sp] ]]; then + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} != -* && ${words[i - 1]} != -[sp] ]]; then cmd="${words[i]}" break fi done - if [[ ! "$cmd" ]]; then + if [[ ! -v cmd ]]; then local tmp=() if [[ ! $cur || $cur == -* ]]; then - tmp+=( $(compgen -W '$(_parse_help "$1" help)' -- "$cur") ) + tmp+=($(compgen -W '$(_parse_help "$1" help)' -- "$cur")) fi if [[ ! $cur || $cur != -* ]]; then - tmp+=( $($1 help 2>&1 | awk '$1 == "adb" { print $2 }') ) - tmp+=( devices connect disconnect sideload ) + tmp+=($($1 help 2>&1 | awk '$1 == "adb" { print $2 }')) + tmp+=(devices connect disconnect sideload) fi - COMPREPLY=( $(compgen -W '${tmp[@]}' -- "$cur") ) + COMPREPLY=($(compgen -W '${tmp[@]}' -- "$cur")) return fi @@ -51,19 +51,19 @@ _adb() _adb_command_usage "$1" $cmd case $cmd in - push|restore|sideload) + push | restore | sideload) _filedir ;; forward) - COMPREPLY=( $(compgen -W \ + COMPREPLY=($(compgen -W \ '$("$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ - _parse_help -)' -- "$cur") ) + _parse_help -)' -- "$cur")) ;; reboot) - COMPREPLY=( $(compgen -W 'bootloader recovery' -- "$cur") ) + COMPREPLY=($(compgen -W 'bootloader recovery' -- "$cur")) ;; esac } && -complete -F _adb adb + complete -F _adb adb # ex: filetype=sh |