Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Gaetan Semet 2017-12-07 17:58:58 +01:00
commit 0aeee26acb
2 changed files with 11 additions and 2 deletions

View file

@ -1,7 +1,7 @@
# adb autocomplete plugin
* Adds autocomplete options for all adb commands.
* Add autocomplete for `adb -s`
## Requirements

View file

@ -43,8 +43,17 @@ local expl
local -a pkgs installed_pkgs
_arguments \
'-s[devices]:specify device:->specify_device' \
'*:: :->subcmds' && return 0
case "$state" in
specify_device)
_values 'devices' $(adb devices|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \
{printf "%s[Device_%d:%s] ",$1,++i,$2 }')
return
;;
esac
if (( CURRENT == 1 )); then
_describe -t commands "adb subcommand" _1st_arguments
return