about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-11-12 11:09:55 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-11-12 11:09:55 +0100
commit0b3b52778bd7a4a2c97637c3d4739a7e66a695b1 (patch)
tree371a1e8f7f7dda9bcc72b28fbf778d08651e2a89 /Completion/Unix/Command
parent082f703ccdfd77fa5301023b3031c873143cdbf3 (diff)
downloadzsh-0b3b52778bd7a4a2c97637c3d4739a7e66a695b1.tar.gz
zsh-0b3b52778bd7a4a2c97637c3d4739a7e66a695b1.tar.xz
zsh-0b3b52778bd7a4a2c97637c3d4739a7e66a695b1.zip
43819: expand adb completion to also cover options to adb backup
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_adb17
1 files changed, 16 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index 776a03cbc..75a447dfc 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -112,6 +112,9 @@ _adb_dispatch_command () {
     (*:adb-shell:)
       (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell
       ;;
+    (*:adb-backup:)
+      (( $+functions[_adb_dispatch_backup] )) && _adb_dispatch_backup
+      ;;
     (*:adb-connect:|*:adb-disconnect:)
       (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling
       ;;
@@ -191,6 +194,18 @@ _adb_dispatch_shell () {
   esac
 }
 
+(( $+functions[_adb_dispatch_backup] )) ||
+_adb_dispatch_backup() {
+  _arguments \
+    '-f[specify backup file]:backup file:_files' \
+    '-apk[backup .apk files]' '!(-apk)-noapk' \
+    '-obb[backup .obb files]' '!(-obb)-noobb' \
+    '-shared[backup shared storage]' '!(-shared)-noshared' \
+    '-all[backup all installed apps]' \
+    '-nosystem[include system apps when backing up all apps]' '!(-nosystem)-system' \
+    '*:package name:_adb_installed_packages'
+}
+
 (( $+functions[_adb_pm_list] )) ||
 _adb_pm_list () {
   case ${words[4]} in
@@ -298,7 +313,7 @@ _adb_package_manager_handler () {
     (getInstallLocation)
       ;;
     (*)
-      _wanted pm_argument expl 'pm argument' compadd list path install unistall enable disable setInstallLocation getInstallLocation
+      _wanted pm_argument expl 'pm argument' compadd list path install uninstall enable disable setInstallLocation getInstallLocation
       ;;
   esac
 }