From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8579 invoked by alias); 9 Jun 2018 20:39:40 -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: 42976 Received: (qmail 14191 invoked by uid 1010); 9 Jun 2018 20:39:40 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.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(66.111.4.25):SA:0(-2.6/5.0):. Processed in 1.899114 secs); 09 Jun 2018 20:39:40 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=f3Ecp+VkcXcF3ffaNH7wEZ0drC5k+ jVAjKkjvAwmbJE=; b=CFFZA82RCDlPkguuIa9OqoHRUcDU5CJObtXfmQb/mCK4e sWB2BBWmU2IZMEAW9+C8rXJhCDCbvVuskz+k4NEPFxHsj76gha93cEw2x0Q4waox 8mKASYwg+HGeohVrLMuFhcuzk2ne6g9Q30D62VVvrjbyn4EuA6sw7EJ5dOejDKif yzWyJZQgvvIx7OxC62XHRqKl6eaOUfDi4oxu5IbwFmjMT1Q3YOmNxfOszVoYnTUZ 5FEjBV246pW4FLwRCaYPcgiS+bff22WnMUYWsP80RXpVXbzhEZAUY/kMZv8oE4IO 1aTisk++pLOVA7SBvL7Hm0ktOCZuCBN5vYbZihewQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=f3Ecp+VkcXcF3ffaNH7wEZ0drC5k+ jVAjKkjvAwmbJE=; b=li28c9OSZIpN7QCdUYleOkhFpuUGrq/Ph64mZWHnhfWgH phyEVaoYRtwAmtYOL3s6pb5wPO3oWMjXZaAg+Uy5M6AYzC9erzShC1cjMOzr+P+P R747T/VRStUxnyxOp3FrBddB+E9imwlyMMxc7x54VHTVAA+AuODvegWxjPw33YiB KRws10fgOjskk58IyaVo3Cbg1CGzrVISeNIWP2vWeKunXcWyqWewFqKx/Jhh3R26 +6oRTZQi/aI75PopGr7PENMcSHMFD/hcxHattjPhyUJsKIpgFqjcNh9rLWjch3h+ 2ON5QSntXqTS4S0A4ke2vcIVmrCyxBID25x5adr+w== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Date: Sat, 9 Jun 2018 20:39:32 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys. Message-ID: <20180609203932.x3s4hbmbl6rtba76@tarpaulin.shahaf.local2> References: <20180609200940.17041-1-doron.behar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609200940.17041-1-doron.behar@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Good morning Doron, Thanks for revising the patch, however, I'm afraid I do have a few more comments: doron.behar@gmail.com wrote on Sat, Jun 09, 2018 at 23:09:40 +0300: > 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=(${(@s.:.)${(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 > + for i in {1..${#secret_keys[@]}}; do > + if [[ ${secret_keys[$i]} == "fpr" ]]; then I'd like to see the 'fpr' thing (which I have pointed out twice by now) fixed before merging. _gpg isn't a function I'm comfortable adding relaxed/inaccurate parsing to, and doing the parsing correctly isn't onerous. > + i=$((i + 1)) > + local j=$i > + while [[ ${secret_keys[$j]} != "fpr" ]] && [ $j -lt ${#secret_keys[@]} ]; do > + if [[ ${secret_keys[$j]} =~ "@" ]]; then This condition false negatives for me, probably because I used a test secret key that didn't have an email address attached. > + emails+="${secret_keys[$j]}" > + uids+="${secret_keys[$i]}" > + break > + fi > + j=$((j + 1)) > + done > + i=$j > + fi > + done > + _describe -t secret-keys 'secret key' uids_and_emails s/uids_and_emails/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) > + _describe -t public-keyids 'public keyids' uids_and_emails Ditto. Thanks for hanging in there. Daniel