zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: completion for adb backup
Date: Mon, 12 Nov 2018 03:06:30 +0100	[thread overview]
Message-ID: <63510-1541988390.238636@h-b4.1OZx.UAb3> (raw)

This expands adb completion to also cover options to adb backup.
There's also a separate typo correction.

Oliver

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
 }

                 reply	other threads:[~2018-11-12  2:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63510-1541988390.238636@h-b4.1OZx.UAb3 \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).