mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
add autocomplete for adb -s option (#6121)
This commit is contained in:
parent
e273cf004e
commit
2af2d1aa31
2 changed files with 11 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
# adb autocomplete plugin
|
# adb autocomplete plugin
|
||||||
|
|
||||||
* Adds autocomplete options for all adb commands.
|
* Adds autocomplete options for all adb commands.
|
||||||
|
* Add autocomplete for `adb -s`
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,17 @@ local expl
|
||||||
local -a pkgs installed_pkgs
|
local -a pkgs installed_pkgs
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
|
'-s[devices]:specify device:->specify_device' \
|
||||||
'*:: :->subcmds' && return 0
|
'*:: :->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
|
if (( CURRENT == 1 )); then
|
||||||
_describe -t commands "adb subcommand" _1st_arguments
|
_describe -t commands "adb subcommand" _1st_arguments
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue