zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Added gpg-zip completion.
@ 2010-07-13  1:29 Michael Hwang
  2010-07-13  2:15 ` Doug Kearns
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Hwang @ 2010-07-13  1:29 UTC (permalink / raw)
  To: zsh-workers; +Cc: Michael Hwang

Hi all,

I added gpg-zip completion. Also fixed up _gpg a little.

Michael Hwang

---
 Completion/Unix/Command/_gpg     |    7 ++++---
 Completion/Unix/Command/_gpg-zip |   30 ++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 Completion/Unix/Command/_gpg-zip

diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg
index 368bfda..27b7459 100644
--- a/Completion/Unix/Command/_gpg
+++ b/Completion/Unix/Command/_gpg
@@ -13,6 +13,7 @@ _arguments -C -s -S -A "-*" \
   '--decrypt[decrypt file or stdin]' \
   '--verify[verify a signature]' \
   '--verify-files[verify a list of files]' \
+  '--multifile[process multiple files]' \
   '(-f --encrypt-files)'{-f,--encrypt-files}'[encrypt files]' \
   '--decrypt-files[decrypt files]' \
   '--list-keys[list all keys]' \
@@ -25,7 +26,7 @@ _arguments -C -s -S -A "-*" \
   '--list-packets[list only the sequence of packets]' \
   '--gen-key[generate a new pair key]' \
   '--edit-key[a menu for edit yours keys]:key attachment:->public-keys' \
-  '--sign-key[sign a key]:key attachment:->public-keys'\
+  '--sign-key[sign a key]:key attachment:->public-keys' \
   '--lsign-key[sign a key but mark as non-exportable]:key attachment:->public-keys' \
   '--nrsign-key[sign a key non-revocably]' \
   '--delete-key[remove key from public keyring]:key attachment:->public-keys' \
@@ -58,7 +59,7 @@ _arguments -C -s -S -A "-*" \
   '(-h --help)'{-h,--help}'[display usage information]' \
   '(-a --armor)'{-a,--armor}'[create ASCII armored output]' \
   '(-o --output)'{-o+,--output}'[write output to file]:output file:_files' \
-  '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users'\
+  '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users' \
   '--default-key[specify default user-id for signatures]:key:->secret-keys' \
   '*'{-r+,--recipient}'[specify user to encrypt for]:recipient:->public-keys' \
   '--default-recipient[specify default recipient]:recipient:->public-keys' \
@@ -84,7 +85,7 @@ _arguments -C -s -S -A "-*" \
   '--keyserver-options[specify keyserver options]:options' \
   '--import-options[specify options for importing keys]:options' \
   '--export-options[specify options for exporting keys]:options' \
-  --show-photos --no-show-photos '--photo-viewer:command:_command_names -e'\
+  --show-photos --no-show-photos '--photo-viewer:command:_command_names -e' \
   --exec-path:path:_dir_list' \
   --show-keyring[display keyring name when listing keys]' \
   '--keyring=[add specified file to list of keyrings]:file:_files' \
diff --git a/Completion/Unix/Command/_gpg-zip b/Completion/Unix/Command/_gpg-zip
new file mode 100644
index 0000000..55ed37d
--- /dev/null
+++ b/Completion/Unix/Command/_gpg-zip
@@ -0,0 +1,30 @@
+#compdef gpg-zip
+
+local curcontext="$curcontext" state line expl ret=1
+typeset -A opt_args
+
+_arguments -C -s -S -A "-*" \
+  '(-d --decrypt)'{-e,--encrypt}'[encrypt data]' \
+  '(-e --encrypt)'{-d,--decrypt}'[decrypt data]' \
+  '(-c --symmetric)'{-c,--symmetric}'[encrypt with symmetric cypher only]' \
+  '(-s --sign)'{-s,--sign}'[make a signature]' \
+  '*'{-r+,--recipient}'[specify user to encrypt for]:recipient:->public-keys' \
+  '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users' \
+  '(-)--list-archive[list archive contents]' \
+  '(-o --output)'{-o+,--output}'[write output to file]:output file:_files' \
+  '--gpg[use specified command instead of gpg]:command:_command_names' \
+  '--gpg-args[gpg arguments]:gpg arguments:' \
+  '--tar-args[tar arguments]:tar arguments:' \
+  '--tar[use specified command instead of tar]:command:_command_names' \
+  '(-h --help)'{-h,--help}'[display usage information]' \
+  '--version[print info on program version]' \
+  '*:files:_files' && ret=0
+
+case "$state" in
+  public-keys)
+    _wanted public-keys expl 'public key' \
+	compadd ${${(Mo)$(_call_program public-keys gpg $needed --list-public-keys --list-options no-show-photos 2>/dev/null):%<*>}//(<|>)/} && return
+  ;;
+esac
+
+return ret
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Added gpg-zip completion.
  2010-07-13  1:29 [PATCH] Added gpg-zip completion Michael Hwang
@ 2010-07-13  2:15 ` Doug Kearns
  2010-07-13 21:34   ` Michael Hwang
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Kearns @ 2010-07-13  2:15 UTC (permalink / raw)
  To: zsh-workers

On Tue, Jul 13, 2010 at 11:29 AM, Michael Hwang
<michael.a.hwang@gmail.com> wrote:
> Hi all,
>
> I added gpg-zip completion. Also fixed up _gpg a little.

Thanks.  It would be better to add gpg-zip completion to _gpg along
with any further gpg* commands.  You can do this by testing the
$service parameter.  There's lots of examples amongst the existing
completion functions.

Regards,
Doug


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Added gpg-zip completion.
  2010-07-13  2:15 ` Doug Kearns
@ 2010-07-13 21:34   ` Michael Hwang
  2010-07-15  3:38     ` Doug Kearns
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Hwang @ 2010-07-13 21:34 UTC (permalink / raw)
  To: Doug Kearns; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

Okay, I've reworked _gpg. I've add gpg-zip completion, added many
missing gpg options, and fixed gpgv's options. I've attached it, since
the diff is bigger than the file.

I'm curious to know if it's possible to get tar and gpg completions
inside of the --{tar,gpg}-args options for gpg-zip.

Michael Hwang

On Mon, Jul 12, 2010 at 10:15 PM, Doug Kearns <dougkearns@gmail.com> wrote:
> On Tue, Jul 13, 2010 at 11:29 AM, Michael Hwang
> <michael.a.hwang@gmail.com> wrote:
>> Hi all,
>>
>> I added gpg-zip completion. Also fixed up _gpg a little.
>
> Thanks.  It would be better to add gpg-zip completion to _gpg along
> with any further gpg* commands.  You can do this by testing the
> $service parameter.  There's lots of examples amongst the existing
> completion functions.
>
> Regards,
> Doug
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Added gpg-zip completion.
  2010-07-13 21:34   ` Michael Hwang
@ 2010-07-15  3:38     ` Doug Kearns
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Kearns @ 2010-07-15  3:38 UTC (permalink / raw)
  To: zsh-workers

On Wed, Jul 14, 2010 at 7:34 AM, Michael Hwang
<michael.a.hwang@gmail.com> wrote:
> Okay, I've reworked _gpg. I've add gpg-zip completion, added many
> missing gpg options, and fixed gpgv's options. I've attached it, since
> the diff is bigger than the file.

Committed, thanks.

> I'm curious to know if it's possible to get tar and gpg completions
> inside of the --{tar,gpg}-args options for gpg-zip.

Yes you can with something like:

compset -q
words=( fake "$words[@]" )
(( CURRENT++ ))
_tar

Regards,
Doug


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-15  3:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-13  1:29 [PATCH] Added gpg-zip completion Michael Hwang
2010-07-13  2:15 ` Doug Kearns
2010-07-13 21:34   ` Michael Hwang
2010-07-15  3:38     ` Doug Kearns

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).