From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27774 invoked by alias); 30 May 2018 19:04:25 -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: 42893 Received: (qmail 21924 invoked by uid 1010); 30 May 2018 19:04:24 -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.563918 secs); 30 May 2018 19:04:24 -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=fEfPGI JQHCSjLNsYtAiEKe8wtGLdKSUJ/5Sfz4ezF8M=; b=BAwAloCtPMDosMqD0r8QKH NK2U4oQO0If7vtnGQp6ITyyA0FUH19x7VTTJAnkvbWeUGuNbwFloLU7r2aWtrdGB jpKz+A0DUGylt2lq4mYWxu07yyNAQtDVuyUW7rxJKLE9BSqLtN5bEI3ZEpbtImNC gCnE2X2Kv8qqyzSrkYRRFPpfaVOSLog8/1v26r0Egr5DDlnUBH2vAz2L2IN0fHa/ TEsZ1anZ6zzmf+YdmIghwRRASaKkl9oFokzf35cK8EfMtYQd6DgDhdb7nrsbf4S7 gO8voikACJEYcLIHHqdUoMA8qeVmmJazz1fvh+D1OzBB1aI5BKDeVa+hEciMm9KA == 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=fEfPGI JQHCSjLNsYtAiEKe8wtGLdKSUJ/5Sfz4ezF8M=; b=BLinK13ztQNV9dV1QUGibN 92lAlp2KtbMbSbuYCx7/f6mlm7lG0A8bL5TeJuk58Td2aiJO0WLjo/0h7P6B6b/v oAkldw+ozUtlBO9mACC6objtKx1c4kOZN+v+WZjosaTE645n3bF8oc/v4LzU0M36 CSTq6YHyJd5l5YQj9U+sKomTHVgop/3nJMx4GIxjjifrW4h+yRdqbbRgQY3EzbSQ DBXPFIiBGZ1cUHKraSTLtf593Vp8gMCHDJIuCyJVVxHBJu0n7+gK4gHnBzcf7aDf kU55Hhs+WCApVm26lKWRDi1VbkUnm7Zz+5y3PatXCt48fFyDkLMLrCJ5L84wxluQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Date: Wed, 30 May 2018 19:04:14 +0000 From: Daniel Shahaf To: Doron Behar Cc: zsh-workers@zsh.org Subject: Re: [PATCH 1/1] _gpg: Use explicit UIDs for state = public keys. Message-ID: <20180530190414.e7khdn2hk5wj4t2s@tarpaulin.shahaf.local2> References: <20180526151628.17983-1-doron.behar@gmail.com> <20180526151628.17983-2-doron.behar@gmail.com> <20180526162541.ejfzrpqwl5lwjkzb@tarpaulin.shahaf.local2> <20180529141034.m45lzzjpjrmo4wjg@NUC.doronbehar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180529141034.m45lzzjpjrmo4wjg@NUC.doronbehar.com> User-Agent: NeoMutt/20170113 (1.7.2) Doron Behar wrote on Tue, May 29, 2018 at 17:11:23 +0300: > I've successfully managed to solve address all the comments you've had > for my patch. Yet, I'm having trouble with `_call_program`. The line I'm > trying to put is this: > > local public_keys=(${(@s.:.)$(_call_program public-keys $words[1] $needed --list-public-keys --list-options no-show-photos --with-colons)}) > > I debugged this a little bit and the variable `$public_keys` is empty > but if I remove the words: `_call_program public-keys` it works good. > > I've had a glimpse at `htop` when this function was called when I tested > the completion function and I saw these commands running there: > > pkgfile -b -v -- --list-public-keys > pkgfile -b -v -- --list-options > pkgfile -b -v -- no-show-photos > pkgfile -b -v -- --with-colons > > What is _call_program supposed to be doing? > _call_program (doc'd in zshcompsys(1)) is supposed to run the command "$words[1] $needed --list-public-keys --list-options no-show-photos --with-colons". The purpose of using _call_program is to allow the user to override the command to use by setting a zstyle. I can't explain the multiple commands you glimpsed in htop. Try changing «$words[1] $needed» to «${(q)words[1]} ${(q)needed}». That adds an additional level of quoting, since one of the differences between «foo bar baz…» and «_call_program x foo bar baz…» is that in the latter case, the «foo bar baz» are eval'd. I'm not sure whether that would fix the failure mode you're seeing, but it's a correct change regardless. I would recommend debugging that line inside out, e.g., start by ensuring the _call_program by itself gets the expected arguments and produced the expected values on its stdout. Enabling tracing («set -x» or «functions -T _call_program») might help. > Besides that, the revised patch is ready. I've also included similar > improvements for the other states - `secret-keys` and `public-keyids`. I look forward to the revised patch. However, I'll be busy in the next few days so I hope another developer would beat me to reviewing/applying it ;-). Cheers, Daniel