Skip to content

Commit

Permalink
#40 adb: Complete connect and disconnect commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoulaj committed Aug 9, 2011
1 parent 0122de4 commit d5eca3a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions _adb
Expand Up @@ -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)
_message 'no more arguments' && ret=0
;;
(connect)
_message '<host>[:<port>]' && ret=0 # TODO Not implemented
;;
(disconnect)
_message '[<host>[:<port>]]' && ret=0 # TODO Not implemented
(connect|disconnect)
_arguments '1: :_adb_host_colon_ports' && ret=0
;;
(push)
_message '<local> <remote>' && ret=0 # TODO Not implemented
Expand Down Expand Up @@ -175,4 +172,15 @@ _adb_scripting_cmds() {
_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 "$@"

0 comments on commit d5eca3a

Please sign in to comment.