Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- X-seq: zsh-workers 42976
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- Date: Sat, 9 Jun 2018 20:39:32 +0000
- 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==
- In-reply-to: <20180609200940.17041-1-doron.behar@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180609200940.17041-1-doron.behar@gmail.com>
Good morning Doron,
Thanks for revising the patch, however, I'm afraid I do have a few more
comments:
doron.behar@xxxxxxxxx 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author