1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-25 17:20:25 +02:00

35531: fallback on file completion

This commit is contained in:
Oliver Kiddle 2015-06-19 20:00:51 +02:00
parent b2de9b518e
commit dd78520897
2 changed files with 17 additions and 11 deletions

View file

@ -1,5 +1,7 @@
2015-06-19 Oliver Kiddle <opk@zsh.org> 2015-06-19 Oliver Kiddle <opk@zsh.org>
* 35531: Completion/Unix/Command/_adb: fallback on file completion
* 35527: Completion/Unix/Type/_email_addresses, * 35527: Completion/Unix/Type/_email_addresses,
Completion/Zsh/Command/_fc, Completion/Zsh/Command/_zpty: Completion/Zsh/Command/_fc, Completion/Zsh/Command/_zpty:
use list-separator style in cases where separator was hardcoded use list-separator style in cases where separator was hardcoded

View file

@ -76,7 +76,8 @@ _adb() {
'(-d -e )-s[serial]: :_adb_device_serial' \ '(-d -e )-s[serial]: :_adb_device_serial' \
'( -e -s)-d[device]' \ '( -e -s)-d[device]' \
'(-d -s)-e[emulator]' \ '(-d -s)-e[emulator]' \
'*:"options":_adb_options_handler' '1:"options":_adb_options_handler' \
'*: : _default'
return; return;
} }
@ -99,27 +100,30 @@ _adb_dispatch_command () {
fi fi
case ${curcontext} in case ${curcontext} in
(*:adb:shell) (*:adb-shell)
(( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_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 (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
;; ;;
(*:adb:logcat) (*:adb-logcat)
(( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat
;; ;;
(*:adb:push) (*:adb-push)
(( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push
;; ;;
(*:adb:pull) (*:adb-pull)
(( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull
;; ;;
(*:adb:install) (*:adb-install)
(( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install
;; ;;
(*:adb:uninstall) (*:adb-uninstall)
(( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall
;; ;;
(*:adb-*)
_default
;;
(*) (*)
_arguments \ _arguments \
'(-d -e)-s["serial"]: :_adb_device_serial' \ '(-d -e)-s["serial"]: :_adb_device_serial' \
@ -143,7 +147,7 @@ _adb_sanitize_context () {
done done
##expand unquoted to remove sparse elements ##expand unquoted to remove sparse elements
mywords=( ${mywords[@]} ) mywords=( ${mywords[@]} )
curcontext="${curcontext}${mywords[-1]}" (( $#mywords )) && curcontext="${curcontext%:*}-${mywords[-1]}:"
} }
(( $+functions[_adb_device_specification] )) || (( $+functions[_adb_device_specification] )) ||
@ -373,9 +377,9 @@ _adb_dispatch_connection_handling () {
fi fi
} }
(( $+functions[adb_check_log_redirect] )) || (( $+functions[_adb_check_log_redirect] )) ||
_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" [[ ${LOG_REDIRECT[1,4]} == "true" ]] && _message -r "Notice: stdio log redirection enabled on the device, so some completions will not work"
} }