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 42926
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: doron.behar@xxxxxxxxx
- Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- Date: Sun, 3 Jun 2018 21:43:50 +0000
- Cc: zsh-workers@xxxxxxx
- 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 ==
- In-reply-to: <20180602152651.16904-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: <20180602152651.16904-1-doron.behar@gmail.com>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author