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 42934
- From: Doron Behar <doron.behar@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- Date: Tue, 5 Jun 2018 18:47:54 +0300
- 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:content-transfer-encoding :in-reply-to:user-agent; bh=1F8Ql4rs7ZG4eviaCAreaHLeG+w75meKLCKR7OBP4Hs=; b=gfzRkhdaYZuVJEoOTPUNY0JFCKcgAEeRICWtsbqPdIB7ABEdEEpTtuk67SuN3+YVc2 IdwOXYyx2pOPYZQDVdHdIKSOtsHKB8FnOcILeRyl7RTRFYPvT0DjVqz2iJo+vt+FCtF4 jDwR1jv5sPpfuaDmkXXevTpHUAPncaNGzV45Ua6KzFdRZaW/B61GyzHzu0VLnMEN3c04 sb2bLwOdIK7WMy+swjWuJO7tvpl5E9+/HeU9RqHV32z1rv2Byid8HVxVOGUrWpiMzv3k I9bZD+9cVSGkbKqoWBpUrFpY35cbrcmkBef4TsgHiFkjMbooXa/4Rr4Ayyoyx5+FM7sl EwWw==
- In-reply-to: <20180603214350.a247lk4n6lbbz56l@tarpaulin.shahaf.local2>
- 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>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180602152651.16904-1-doron.behar@gmail.com> <20180603214350.a247lk4n6lbbz56l@tarpaulin.shahaf.local2>
On Sun, Jun 03, 2018 at 09:43:50PM +0000, Daniel Shahaf wrote:
> doron.behar@xxxxxxxxx wrote on Sat, Jun 02, 2018 at 18:26:51 +0300:
> > From: Doron Behar <doron.behar@xxxxxxxxx>
> >
> > Use the `--with-colons` option and parse the output.
> > ---
> > Completion/Unix/Command/_gpg | 69 ++++++++++++++++++++++++++++++++----
> > 1 file changed, 63 insertions(+), 6 deletions(-)
> >
> > diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg
> > index 48a36eff2..7e707c5f6 100644
> > --- a/Completion/Unix/Command/_gpg
> > +++ b/Completion/Unix/Command/_gpg
> > @@ -206,20 +206,77 @@ 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=(${(@s.:.)$(_call_program public-keys eval IFS=$'\n' $words[1] $needed --list-public-keys --list-options no-show-photos --with-colons)})
>
> This isn't quite right.
>
> The first argument to «eval» here is the five bytes «IFS=\n» (where \n stands
> for an 0x0A byte), so the eval'd code sets IFS to the empty string, not to the
> one-byte string $'\n', and the assignment isn't specific to the command either.
>
> I'm not sure what value you _meant_ to set IFS to. If you meant to set it to a
> newline, you could do something like this:
>
> …$(_call_program public-keys eval IFS=${(q):-$'\n'} ${(q)words[1]} ${(q)needed} --list-public-keys --list-options no-show-photos --with-colons)…
>
> I also added (q) to the other variable expansions.
Actually, I've mistakenly sent the patch with eval, I got confused with
`env` which was my original intention. Both using my original version
with `env` instead of `eval` and your version with the quoted IFS work,
what shall it be?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author