diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2018-01-06 15:59:31 -0500 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2018-01-06 15:59:31 -0500 |
commit | b388fd7fdaccf2875cb5ef58c100dd7634b74bc3 (patch) | |
tree | 0aa4bf4a57af8a9813f225edb38ff15b0191b689 /plugins/adb | |
parent | a5346aae8c853152be234b5b9efe4e1b3684b371 (diff) | |
parent | c3b072eace1ce19a48e36c2ead5932ae2d2e06d9 (diff) | |
download | zsh-b388fd7fdaccf2875cb5ef58c100dd7634b74bc3.tar.gz zsh-b388fd7fdaccf2875cb5ef58c100dd7634b74bc3.tar.bz2 zsh-b388fd7fdaccf2875cb5ef58c100dd7634b74bc3.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/adb')
-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..8cbf6593c 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 -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \ + {printf "%s[%s] ",$1,$6 }') + return + ;; +esac + if (( CURRENT == 1 )); then _describe -t commands "adb subcommand" _1st_arguments return fi -_files +_files
\ No newline at end of file |