From: Michael Hwang <michael.a.hwang@gmail.com>
To: zsh-workers@zsh.org
Cc: Michael Hwang <michael.a.hwang@gmail.com>
Subject: [PATCH] Added gpg-zip completion.
Date: Mon, 12 Jul 2010 21:29:56 -0400 [thread overview]
Message-ID: <1278984596-10715-1-git-send-email-michael.a.hwang@gmail.com> (raw)
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
next reply other threads:[~2010-07-13 1:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 1:29 Michael Hwang [this message]
2010-07-13 2:15 ` Doug Kearns
2010-07-13 21:34 ` Michael Hwang
2010-07-15 3:38 ` Doug Kearns
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=1278984596-10715-1-git-send-email-michael.a.hwang@gmail.com \
--to=michael.a.hwang@gmail.com \
--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).