Commit 2af2d1aa authored by kg's avatar kg Committed by Robby Russell
Browse files

add autocomplete for adb -s option (#6121)

parent e273cf00
# adb autocomplete plugin
* Adds autocomplete options for all adb commands.
* Add autocomplete for `adb -s`
## Requirements
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment