From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14202 invoked by alias); 1 Jul 2018 16:00:21 -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: List-Unsubscribe: X-Seq: 43120 Received: (qmail 22262 invoked by uid 1010); 1 Jul 2018 16:00:21 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.50):SA:0(-1.9/5.0):. Processed in 1.071656 secs); 01 Jul 2018 16:00:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: doron.behar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2dBLPc/dD3tBIBOKrPCVVNGVcCCIOCYPTMxzXFy8U2s=; b=QubFWD+ox0VSIPhGudszeLwWcPgfT38OnJVAPSvy1bcbaWrbE40c96L6FW3QeZiLfn eXi0S73rEfwhxxWbr29K2fgS6Ar7ghEAFmZSdiSl/aTBH/F36CskmNdgMFG+5VHyV9jc xoUumVSjLQZGh+dPMloKiGf/KfD+ZRXKeeWxBR4saery0G2PjLhMtshbcuDkv7Sv+zfW 9aJASn1FYUHNic4kzrXeTj+oZRQM+4eBIfEqIRF02oExmLvt+efUlQPHgfSsDM+jOGSi FKuaAg1OOH7UUJuaVacacpPgJCxO9MP5opqNQJMTYS4t+edIzD3ZqREO4s4XVv4Q6tik F22A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=2dBLPc/dD3tBIBOKrPCVVNGVcCCIOCYPTMxzXFy8U2s=; b=soZ1qUyEVhYxwWoRi+rLI5d4KJpUwTlM7pFwJrdH/d8Jej/yL05HZFVfjfjlQ9HyII ip1tyGl73OBF6TweSjeujzputUXyuWS9hCLKfWZwEH9H0epb0sOACnv0cyX3HWfe4OtB DYRJF4IClOCa2wH9OFqoq6GSp0iloP9NOLt+mY0xTdI6KXd/whfL7O295m4poLYS0At5 BBKMFQRTJtQ9z0gWo8Hgy/mzo0i+dNS6+2FFX+hz42xuUappGkqk1H//Uom5ZdPaWKLm YHu/iaVBL1RX7ksZtGhIlli3R1zeF+5v19n13+sLFY/C6xB/pfrjPQIjh1Cv39mUT7PB WM9g== X-Gm-Message-State: APt69E06K6QYlZYt5okfEvEXB8B88oERj/mdBEF54qcOAuIbYy8C3P9m vU0cqYUXe79f59+Pnsf8aBXBJ4ZD X-Google-Smtp-Source: AAOMgpdlSQiXoZz2mwEskK6OOwRmKtJ+1wN+PiXNc9yGOkU1yhvCaGdUp5m6GFdBI+zzkpLe9DQQAw== X-Received: by 2002:a1c:b49:: with SMTP id 70-v6mr5827264wml.5.1530460815703; Sun, 01 Jul 2018 09:00:15 -0700 (PDT) Date: Thu, 28 Jun 2018 16:43:10 +0300 From: Doron Behar To: zsh-workers@zsh.org Subject: Re: [PATCH] _gpg: Use explicit UIDs for state = public keys. Message-ID: <20180628134310.nnp5rclhvp7fovb3@NUC.doronbehar.com> Mail-Followup-To: zsh-workers@zsh.org References: <20180618194748.4676-1-doron.behar@gmail.com> <20180623172637.tt5xittrjfjhwboc@NUC.doronbehar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180623172637.tt5xittrjfjhwboc@NUC.doronbehar.com> User-Agent: NeoMutt/20180622 Hey guys, just reminding you there is still a patch here waiting for you to merge it. On Sat, Jun 23, 2018 at 08:26:37PM +0300, Doron Behar wrote: > Hey guys, is this patch O.K? Can we merge it please? I've been waiting a > while for a response now, it'll be great to get some feedback. > > On Mon, Jun 18, 2018 at 10:47:48PM +0300, doron.behar@gmail.com wrote: > > From: Doron Behar > > > > Use the `--with-colons` option and parse the output according to the > > format specified in the documentation. > > --- > > Completion/Unix/Command/_gpg | 62 ++++++++++++++++++++++++++++++++---- > > 1 file changed, 55 insertions(+), 7 deletions(-) > > > > diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg > > index 48a36eff2..b35693d1f 100644 > > --- a/Completion/Unix/Command/_gpg > > +++ b/Completion/Unix/Command/_gpg > > @@ -206,20 +206,68 @@ fi > > > > case "$state" in > > public-keys) > > - _wanted public-keys expl 'public key' \ > > - compadd ${${(Mo)$(_call_program public-keys $words[1] $needed --list-public-keys --list-options no-show-photos):%<*>}//(<|>)/} && return > > + local public_keys_lines=(${(f)"$(_call_program public-keys ${(q)words[1]} ${(q)needed} --list-public-keys --list-options no-show-photos --with-colons)"}) > > + local -a uids emails > > + local i j parts current_uid > > + for (( i = 1; i < ${#public_keys_lines[@]}; ++i )); do > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + if [[ ${parts[1]} == "fpr" ]]; then > > + current_uid="${parts[10]}" > > + i=$((i + 1)) > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + while [[ ${parts[1]} == "uid" ]]; do > > + uids+=("${current_uid}") > > + emails+=("${parts[10]}") > > + i=$((i + 1)) > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + done > > + fi > > + done > > + _describe -t public-keys 'public key' emails uids > > ;; > > secret-keys) > > - _wanted secret-keys expl 'secret key' compadd \ > > - ${${(Mo)$(_call_program secret-keys $words[1] $needed --list-secret-keys --list-options no-show-photos):%<*>}//(<|>)/} && return > > + local secret_keys_lines=(${(f)"$(_call_program secret-keys ${(q)words[1]} ${(q)needed} --list-secret-keys --list-options no-show-photos --with-colons)"}) > > + local -a uids emails > > + local i j parts current_uid > > + for (( i = 1; i < ${#secret_keys_lines[@]}; ++i )); do > > + parts=("${(@s.:.)secret_keys_lines[$i]}") > > + if [[ ${parts[1]} == "fpr" ]]; then > > + current_uid="${parts[10]}" > > + i=$((i + 1)) > > + parts=("${(@s.:.)secret_keys_lines[$i]}") > > + while [[ ${parts[1]} == "uid" ]]; do > > + uids+=("${current_uid}") > > + emails+=("${parts[10]}") > > + i=$((i + 1)) > > + parts=("${(@s.:.)secret_keys_lines[$i]}") > > + done > > + fi > > + done > > + _describe -t secret-keys 'secret key' emails uids > > ;; > > ciphers) > > _wanted ciphers expl cipher compadd \ > > - ${${(s.,.)${(M)${(f)${"$(_call_program ciphers $words[1] $needed --version)"}//,$'\n' #/, }:#Cipher*}#*:}# } && return > > + ${${(s.,.)${(M)${(f)${"$(_call_program ciphers ${(q)words[1]} ${(q)needed} --version)"}//,$'\n' #/, }:#Cipher*}#*:}# } && return > > ;; > > (public-keyids) > > - _wanted public-keys expl 'public keyid' \ > > - compadd ${(M)${${(f)"$(_call_program public-keyids $words[1] $needed --list-public-keys --list-options no-show-photos)"}## #}:#[0-9A-F](#c40)} && return > > + local public_keys_lines=(${(f)"$(_call_program public-keyids ${(q)words[1]} ${(q)needed} --list-public-keys --list-options no-show-photos --with-colons)"}) > > + local -a uids emails > > + local i j parts current_uid > > + for (( i = 1; i < ${#public_keys_lines[@]}; ++i )); do > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + if [[ ${parts[1]} == "fpr" ]]; then > > + current_uid="${parts[10]}" > > + i=$((i + 1)) > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + while [[ ${parts[1]} == "uid" ]]; do > > + uids+=("${current_uid}") > > + emails+=("${parts[10]}") > > + i=$((i + 1)) > > + parts=("${(@s.:.)public_keys_lines[$i]}") > > + done > > + fi > > + done > > + _describe -t public-keyids 'public key' emails uids > > ;; > > (option-list) > > _sequence _wanted options expl option \ > > -- > > 2.17.1 > >