From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20904 invoked by alias); 13 Jul 2010 01:30:53 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28070 Received: (qmail 11664 invoked from network); 13 Jul 2010 01:30:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) 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= From: Michael Hwang To: zsh-workers@zsh.org Cc: Michael Hwang Subject: [PATCH] Added gpg-zip completion. Date: Mon, 12 Jul 2010 21:29:56 -0400 Message-Id: <1278984596-10715-1-git-send-email-michael.a.hwang@gmail.com> X-Mailer: git-send-email 1.7.1.1 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