Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Added gpg-zip completion.
- X-seq: zsh-workers 28070
- From: Michael Hwang <michael.a.hwang@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Added gpg-zip completion.
- Date: Mon, 12 Jul 2010 21:29:56 -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=HfpfQoC4dk8BwPm8DkpjC1GwjMCJBrY7u0icPEY0dss=; b=guUn9wVTQ7yVQM56+l7l7g2UIZPYsAvVtYTJjOczogNxfUBIVqwrhDQy30HjLYrCAI 88IsLSoNrSw95qvy6YiNHKpKa3qlivWGL3taZhQNqwTwAeb/r/dAJkHw3NmS3jMDR5xp GtXMCwit2cGsf1nXLo5FIRDkfPr0YFS2/yISA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=dlFciNe9tjCGfHRO35Uf+tVcEg0yrIeBT01ry1nmuppcPzcHpYMGw9U2V9au7nhPd6 TMlrYjmEs2TCh3sUz4Nqkq/ujs52pivv4pjNxf3HM5o3fLHbz8D4sBsTExIyszPqeP7x o8KMyXRvRlTp9EFmKPpL/bpM9NhZz7IVnszn4=
- 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
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author