From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15967 invoked by alias); 3 Jun 2018 21:51:15 -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: 42926 Received: (qmail 18021 invoked by uid 1010); 3 Jun 2018 21:51:15 -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.057983 secs); 03 Jun 2018 21:51:15 -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=cc: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=7T+6Xc T9jYQ7luA9xWRCFrIxP78PIdN+FrfJ8957fXg=; b=eFayWdFXHCOpYARaFhtEYi O1dzj92CDNempK/r08IJKQ08vx7zU/YUKh4GD5s744wkQb2kvi923H2hqNAq64/2 bDcfhIhtrdUgq8jPXY888vzvkeokwTAcsLUm7YdkLgAQJKQXe/draw80OimrtRe2 lLyTiTscucFXxHTj7tWuhZ9zo4nuvw9sYIi5WbfTQpAAdTw3GGNS/VK75ZjqK5wS mNcpUxLW3bw+TGvVQu0baN+FWmbmmjdivVVQxj0q6dxwZhVZFgu9If1Thv98iDWj aOpmfDP23Z3yuja4lt+/2unHOQs7AHtUL9ArldquLIz25JokLCm23DMHcVVAl2bA == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=7T+6Xc T9jYQ7luA9xWRCFrIxP78PIdN+FrfJ8957fXg=; b=mkNxzKemosJ9FjDyssEuWi XzsTs4omnpXZgeL7n/afyCtiiEC6Y7YbN8r2AJ59gDiox4b2UgWE/q6ANhWyUdkh 7mW5PEHaQVBVbAj4ix1E94Fi/6JXQX2hCm/jtSgaKBTJ96XHvBZ1vs1uIJIWZuO+ 4v5bYRq0WLMqSt2qi449XTbs6zLEqvyVc8LJjuvbN4Ozik4kIQKtZ740iPKikdEL WKqmmmIxbARRRI4n/d8bexS9v5hrj/hDbEDHbsW37pVksgvFeYM4VKEllLrALjcM GfuUeCJ5P2VvmEyj7MFwEgN4SnjP/FyXB7PebklrzAUZm3EzOXvlCL/OBH4N7oDw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Date: Sun, 3 Jun 2018 21:43:50 +0000 From: Daniel Shahaf To: doron.behar@gmail.com Cc: zsh-workers@zsh.org Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys. Message-ID: <20180603214350.a247lk4n6lbbz56l@tarpaulin.shahaf.local2> References: <20180602152651.16904-1-doron.behar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180602152651.16904-1-doron.behar@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) doron.behar@gmail.com wrote on Sat, Jun 02, 2018 at 18:26:51 +0300: > From: Doron Behar > > 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.