Skip to content

Commit

Permalink
#40 adb: Extract default completer for remote command to a separate f…
Browse files Browse the repository at this point in the history
…unction
  • Loading branch information
nicoulaj committed Aug 21, 2011
1 parent 93768e5 commit 812e448
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions _adb
Expand Up @@ -98,9 +98,14 @@ _adb() {
case "$state" in
(remote-command-args)
if (( $+functions[_adb_remote_command_$words[1]_args] )); then
_adb_remote_command_$words[1]_args && ret=0
_adb_remote_command_$words[1] && ret=0
# TODO Write handlers for following commands:
# * am (Activity Manager)
# * pm (Package Manager)
# TODO Reuse existing compdefs for standard commands (ls, id, ifconfig, kill, etc) ?
# How do we tell them to use _remote_ files/pids/users/etc ?
else
_wanted remote-files expl 'remote file' _adb_remote_files && ret=0
_adb_remote_command_default && ret=0
fi
;;
esac
Expand Down Expand Up @@ -398,4 +403,9 @@ _adb_logcat_buffers() {
_describe -t log-buffers 'log buffer' buffers "$@" && ret=0
}

(( $+functions[_adb_remote_command_default] )) ||
_adb_remote_command_default() {
_wanted remote-files expl 'remote file' _adb_remote_files
}

_adb "$@"

0 comments on commit 812e448

Please sign in to comment.