summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_adb
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-08-22 01:55:58 +0200
commit02f6e25bfcd5feb9a093377dda0dd549cdf5c309 (patch)
tree9a25e61122b3fa0d0a1ff68b5ef05c775ff78b1e /Completion/Unix/Command/_adb
parente04a19735ffc8523b93b33074f685ad4e2c92e0c (diff)
parent881474edcb223ac22a08d81a824809c33ca3a9c9 (diff)
downloadzsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.tar.gz
zsh-02f6e25bfcd5feb9a093377dda0dd549cdf5c309.zip
Merge tag 'zsh-5.0.8-test-2' into debian
Diffstat (limited to 'Completion/Unix/Command/_adb')
-rw-r--r--Completion/Unix/Command/_adb26
1 files changed, 15 insertions, 11 deletions
diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index e687762d3..88aca2464 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -76,7 +76,8 @@ _adb() {
'(-d -e )-s[serial]: :_adb_device_serial' \
'( -e -s)-d[device]' \
'(-d -s)-e[emulator]' \
- '*:"options":_adb_options_handler'
+ '1:"options":_adb_options_handler' \
+ '*: : _default'
return;
}
@@ -99,27 +100,30 @@ _adb_dispatch_command () {
fi
case ${curcontext} in
- (*:adb:shell)
+ (*:adb-shell)
(( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell
;;
- (*:adb:connect|*:adb:disconnect)
+ (*:adb-connect|*:adb-disconnect)
(( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
;;
- (*:adb:logcat)
+ (*:adb-logcat)
(( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat
;;
- (*:adb:push)
+ (*:adb-push)
(( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push
;;
- (*:adb:pull)
+ (*:adb-pull)
(( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull
;;
- (*:adb:install)
+ (*:adb-install)
(( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install
;;
- (*:adb:uninstall)
+ (*:adb-uninstall)
(( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall
;;
+ (*:adb-*)
+ _default
+ ;;
(*)
_arguments \
'(-d -e)-s["serial"]: :_adb_device_serial' \
@@ -143,7 +147,7 @@ _adb_sanitize_context () {
done
##expand unquoted to remove sparse elements
mywords=( ${mywords[@]} )
- curcontext="${curcontext}${mywords[-1]}"
+ (( $#mywords )) && curcontext="${curcontext%:*}-${mywords[-1]}:"
}
(( $+functions[_adb_device_specification] )) ||
@@ -373,9 +377,9 @@ _adb_dispatch_connection_handling () {
fi
}
-(( $+functions[adb_check_log_redirect] )) ||
+(( $+functions[_adb_check_log_redirect] )) ||
_adb_check_log_redirect () {
- LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)//
+ LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio 2>/dev/null)//
/}
[[ ${LOG_REDIRECT[1,4]} == "true" ]] && _message -r "Notice: stdio log redirection enabled on the device, so some completions will not work"
}