Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: completion for adb backup
- X-seq: zsh-workers 43819
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: completion for adb backup
- Date: Mon, 12 Nov 2018 03:06:30 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1541988391; bh=C+2+c0bmX7zM/d2Jtmnzv+Odb4PSIV/Cfc6tgSxzVyk=; h=From:To:Subject:Date:From:Subject; b=FLSdd2YOIcDQID3BAd4le2K7pGlZpzu1exl43+qyBz4AVvv488HCPBY4rHToJblA8MYbYbGU5CmAvdrZu1S0pspOacDela95jQ4lADa57Hj5+GVWtWEhPZ/Eo2qiEUgMmLqvdD57SaKlmivYLcrvigrvPyxJAmi0UgaP2jZLyr8Yj+KcKCLogRPiy55LpRKw0Fhb0I0/L68uueYjv0QmuETPlGJnzkcJT4bacUMREl1bkMNwNPEFFcRziY24ZGRGjAPzbgBvviSm84qgh1kRx2BoyE2rqibeWsd2Qk6Qw7icUJIuLGYCO1cQV01owjYE1jFXoA7jubwkxCl5f4B9lA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author