* [PATCH] Allow completions inside --{gpg,tar}-args in gpg-zip.
@ 2010-07-15 20:32 Michael Hwang
0 siblings, 0 replies; only message in thread
From: Michael Hwang @ 2010-07-15 20:32 UTC (permalink / raw)
To: zsh-workers; +Cc: Michael Hwang
--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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-15 20:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15 20:32 [PATCH] Allow completions inside --{gpg,tar}-args in gpg-zip Michael Hwang
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).