Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Allow completions inside --{gpg,tar}-args in gpg-zip.
- X-seq: zsh-workers 28082
- From: Michael Hwang <michael.a.hwang@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Allow completions inside --{gpg,tar}-args in gpg-zip.
- Date: Thu, 15 Jul 2010 16:32:13 -0400
- Cc: Michael Hwang <michael.a.hwang@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=/Od0apgf4N1m1CQ8/4p16a30P3zoyPF3o5MqXV6JcEg=; b=L33bTzfzyyHDkn4NRrOaD9SdyvUWchM5SzPBB2wfHll+LyzB5UPIF0Qp2Pnh6kCvT3 W5Zm1UFAFolWFbMMafDmUCh2/qFoc3qQGShc1KXKfJ9y1ACmah/BjYhjd36neiGtSU+A L7TqqM2O9JpUXM4wpIaHYUbH+ojq3GSZIysuE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=QWhCvlw6qUdgrpAdXLACzFRtQGaThjmVWYXP6bfWxYHFgNibIxIr/HF3MtwGUXbWS6 dPMKHE7XOfZ0gHM1H50Cms2B5POojoZ26ft6e3vm0xNvP3xEQE+5ulEgRCo1qOMRUYRT UJVjptwXOl0NNWp8AE3b3VsaWIetYPA2Mqh+g=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
--gpg-args and --tar-args will complete based on values in --gpg and --tar, respectively. Also fixed return values.
Michael Hwang
---
Completion/Unix/Command/_gpg | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg
index 3f86411..9b862cf 100644
--- a/Completion/Unix/Command/_gpg
+++ b/Completion/Unix/Command/_gpg
@@ -12,9 +12,9 @@ gpgv=('(-q --quiet)*'{-v,--verbose}'[increase amount of output]'
'--homedir:directory:_directories')
gpgzip=('--gpg[command to use instead of gpg]:command:_command'
- '--gpg-args[gpg arguments]:gpg arguments:'
+ '--gpg-args[gpg arguments]:gpg arguments:->gpg'
'--tar[command to use instead of tar]:command:_command'
- '--tar-args[tar arguments]:tar arguments:'
+ '--tar-args[tar arguments]:tar arguments:->tar'
'--list-archive[list archive contents]')
gpgbasic=('(-e --encrypt)'{-e,--encrypt}'[encrypt data. this option may be combined with --sign]'
@@ -193,15 +193,15 @@ gpgextra=('--decrypt-files[decrypt multiple files]'
case "$service" in
gpg)
- _arguments -C -s -S -A "-*" $gpgbasic $gpgextra $gpgv '*:args:->args'
+ _arguments -C -s -S -A "-*" $gpgbasic $gpgextra $gpgv '*:args:->args' && ret=0
;;
gpgv)
- _arguments -C -s -S -A "-*" $gpgv '*:args:->args'
+ _arguments -C -s -S -A "-*" $gpgv '*:args:->args' && ret=0
;;
gpg-zip)
- _arguments -C -s -S -A "-*" $gpgbasic $gpgzip '*:args:->args'
+ _arguments -C -s -S -A "-*" $gpgbasic $gpgzip '*:args:->args' && ret=0
;;
esac
@@ -249,6 +249,12 @@ case "$state" in
_wanted public-keys expl 'public keyid' \
compadd ${${${(M)${(f)"$(_call_program public-keyids gpg $needed --list-public-keys --list-options no-show-photos 2>/dev/null)"}:%pub*}#pub */}%% *} && return
;;
+ (tar|gpg)
+ compset -q
+ words=( ${opt_args[--${state}]:-${state}} "$words[@]" )
+ (( CURRENT++ ))
+ _normal && return
+ ;;
esac
return ret
--
1.7.1.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author