diff options
author | kg <kjxstar@gmail.com> | 2017-12-05 07:08:07 +0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2017-12-04 15:08:07 -0800 |
commit | 2af2d1aa31caa534c419e72d75daa667ff725de2 (patch) | |
tree | d060a2e39ecba9d97bd1b18ee9427943881923fe /plugins | |
parent | e273cf004e1ff0510aee61416885f3003bcd15d9 (diff) | |
download | zsh-2af2d1aa31caa534c419e72d75daa667ff725de2.tar.gz zsh-2af2d1aa31caa534c419e72d75daa667ff725de2.tar.bz2 zsh-2af2d1aa31caa534c419e72d75daa667ff725de2.zip |
add autocomplete for adb -s option (#6121)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/adb/README.md | 2 | ||||
-rw-r--r-- | plugins/adb/_adb | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/plugins/adb/README.md b/plugins/adb/README.md index 075beec0e..83dcc7288 100644 --- a/plugins/adb/README.md +++ b/plugins/adb/README.md @@ -1,7 +1,7 @@ # adb autocomplete plugin * Adds autocomplete options for all adb commands. - +* Add autocomplete for `adb -s` ## Requirements diff --git a/plugins/adb/_adb b/plugins/adb/_adb index 5f37bedac..2e3c3658e 100644 --- a/plugins/adb/_adb +++ b/plugins/adb/_adb @@ -43,11 +43,20 @@ 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 fi -_files +_files
\ No newline at end of file |