From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7383 invoked by alias); 7 Jun 2018 06:40:22 -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: 42941 Received: (qmail 5672 invoked by uid 1010); 7 Jun 2018 06:40:22 -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 2.265448 secs); 07 Jun 2018 06:40:22 -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-transfer-encoding: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=k+mRin zLbwaXz6h1+WY8hZaZ5lbP2Fe/4s0zX/SyN6M=; b=hO1wz29XLdPNBI6Yz0XIkI zMBdDu6kAvR0ovihrJ2mFkDKALy0l/fk2UX4mQK4vG5rBzpJToQpOPXwSiPTSqzg z5RVE2+PQm7yOJ0I7f7xBNXCFYrQy0yi92+Mfl3hcbwlEXeuPVO9jaAp+jBjSETz sC/G/lMMf6SdcIDEFbmhlBfj7dXzyjJR3zqVKz+jF75T3GAq+vNdvAZxv14v41mQ St08iGwI3S4vRZQAoklJS2hRIN6IPfJlDMLnTx52M6I40wvCHPjm2T1fhj4Swrdw vYL3tWX7c5xWmt5vi6BS60Gj6mR+yUpqFaZGACrxo6esxCNRSPV/dVeL/7DglXfg == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=k+mRin zLbwaXz6h1+WY8hZaZ5lbP2Fe/4s0zX/SyN6M=; b=FIavD2DUzXNhdUM2t3vT8d MO/yaLiXmPxT37BGBFa6mW5EzQgC/9RXjtPLIkIcDB7jiCkETOtcYtOoXR1J+8a5 ibAlqGAQWvj7ZPbZX38ZsyfvTw6til52l0bWJUh7MiIQpaXket5ZZe1hSIkOBqyX WZge0GoRUwqEJv5opBBYmHmbsKutvY8MLu3vBpCxugeebhjpwBYCQqjpQSpfQ1h2 3+C2ybeQuT/iif2mBNumLsXmEaB+QPyz6WRFc+hVu8Day0yRC5QkayCE40UxEWv5 VqQIwwnkuAxmr6TbAKOh+kdC8kfAWoQiyWVzQ4MY8eG8N3b4i2H4hh3W3Hf56UCw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Message-Id: <1528353614.2427328.1399370296.413C61E3@webmail.messagingengine.com> From: Daniel Shahaf To: Doron Behar , zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-fb4a77ea Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys. In-Reply-To: <20180605154751.6jx27re6d3pgdgxd@NUC.doronbehar.com> Date: Thu, 07 Jun 2018 06:40:14 +0000 References: <20180602152651.16904-1-doron.behar@gmail.com> <20180603214350.a247lk4n6lbbz56l@tarpaulin.shahaf.local2> <20180605154751.6jx27re6d3pgdgxd@NUC.doronbehar.com> Doron Behar wrote on Tue, 05 Jun 2018 18:47 +0300: > On Sun, Jun 03, 2018 at 09:43:50PM +0000, Daniel Shahaf wrote: > > doron.behar@gmail.com wrote on Sat, Jun 02, 2018 at 18:26:51 +0300: > > > From: Doron Behar > > >=20 > > > Use the `--with-colons` option and parse the output. > > > --- > > > Completion/Unix/Command/_gpg | 69 ++++++++++++++++++++++++++++++++--= -- > > > 1 file changed, 63 insertions(+), 6 deletions(-) > > >=20 > > > 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 > > >=20=20 > > > case "$state" in > > > public-keys) > > > - _wanted public-keys expl 'public key' \ > > > - compadd ${${(Mo)$(_call_program public-keys $words[1] $needed --lis= t-public-keys --list-options no-show-photos):%<*>}//(<|>)/} && return > > > + local public_keys=3D(${(@s.:.)$(_call_program public-keys eval I= FS=3D$'\n' $words[1] $needed --list-public-keys --list-options no-show-phot= os --with-colons)}) > >=20 > > This isn't quite right. > >=20 > > The first argument to =C2=ABeval=C2=BB here is the five bytes =C2=ABIFS= =3D\n=C2=BB (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. > >=20 > > 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: > >=20 > > =E2=80=A6$(_call_program public-keys eval IFS=3D${(q):-$'\n'} ${(q)= words[1]} ${(q)needed} --list-public-keys --list-options no-show-photos --w= ith-colons)=E2=80=A6 > >=20 > > I also added (q) to the other variable expansions. >=20 > 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? IFS should never be exported, so use eval please. Please use double escaping, though (that is, ${(q)${(q)foo}}: that's needed= since _call_program does an eval anyway, in addition to the one you spell out in _call_program's arguments.