#40 adb: Complete connect and disconnect commands

This commit is contained in:
Julien Nicoulaud 2011-08-09 14:30:50 +02:00
parent 0122de4caa
commit d5eca3a6bf
1 changed files with 13 additions and 5 deletions

18
_adb
View File

@ -67,11 +67,8 @@ _adb() {
(help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb) (help|version|devices|jdwp|bugreport|wait-for-device|start-server|kill-server|get-state|get-serialno|status-window|remount|reboot-bootloader|root|usb)
_message 'no more arguments' && ret=0 _message 'no more arguments' && ret=0
;; ;;
(connect) (connect|disconnect)
_message '<host>[:<port>]' && ret=0 # TODO Not implemented _arguments '1: :_adb_host_colon_ports' && ret=0
;;
(disconnect)
_message '[<host>[:<port>]]' && ret=0 # TODO Not implemented
;; ;;
(push) (push)
_message '<local> <remote>' && ret=0 # TODO Not implemented _message '<local> <remote>' && ret=0 # TODO Not implemented
@ -175,4 +172,15 @@ _adb_scripting_cmds() {
_describe -t scripting-commands 'scripting command' commands "$@" _describe -t scripting-commands 'scripting command' commands "$@"
} }
(( $+functions[_adb_host_colon_ports] )) ||
_adb_host_colon_ports() {
local ret=1
if compset -P '*:'; then
_message 'port' && ret=0
else
_wanted hosts expl 'host' _hosts -qS: && ret=0
fi
return ret
}
_adb "$@" _adb "$@"