Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Added gpg-zip completion.



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