From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0a6c4aaa for ; Sat, 2 Nov 2019 07:46:38 +0000 (UTC) Received: (qmail 23238 invoked by alias); 2 Nov 2019 07:46:33 -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: 44887 Received: (qmail 2074 invoked by uid 1010); 2 Nov 2019 07:46:33 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25615. spamassassin: 3.4.2. Clear:RC:0(66.111.4.26):SA:0(-2.6/5.0):. Processed in 4.53315 secs); 02 Nov 2019 07:46:33 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type :content-transfer-encoding; s=fm1; bh=p6SasrV6OiATvYcGoWBLNJEAtc khVohGNPZfDXbC28Y=; b=R2oAn3KVwJ8Z/y2qJyXraghIxk3Zwhgjhna9FiBa6X O6xcG1SNvipQKvZpgYwq6z/+fNcy6u0zwkaf3xqLSfXQhW0N15bLO9cLVYM4bJQ0 Y7uCIbJVo+CzuRez7/wu66C6gMGaXUarq3VOzWbHwT6BRqkMMiYsDjS7pGlWveFN UWqq+7A3KyVWpbSuy+12oZM81JTv85aSAX2gKNeVuj+uPnWybZtUNGZ8vqjDYMLm uVic817mpr2IVqCk3u5gYtfXuOGkQUSKtsJ2xy0jwkl2zkwGSIL9redkyFw5fDOq ujNhtvfTSf+2OJrp5MBuAveYvYcStp43YmFgLvJJMkWw== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=p6SasrV6OiATvYcGoWBLNJEAtckhVohGNPZfDXbC2 8Y=; b=upueOiHyCLMwbOCwghxDwKYfaxlEi4YizaxG3q+PNYi9EkJKkGfWSuFRX ZF7Kzfa3C5JKd9wGKFcho89jkB+eTGEQksXrINoYSeKQ12Q7idq4k8iFl7BVDwqW NuH3iGHgSYOF87gdq26GSTpXoIBqgyi9deKIyEJlhKs+cm0xJEQkz0PnbwcATEam mKnPjB80EtEM2s/dEat/bosA0k/4TCO7lAaeuxgHk08a/i1B1CsSj0NKNKn+hnA8 xP5MJAxlrx24DL/6rWBiaVBWCcUzgUKSb1eNRh1b6r/ye0epqVylTsfmBhCfvQgQ G6lFi9G9dxYWEXadupA8JoGVCNI5A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtkedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgfgse htqhertderreejnecuhfhrohhmpedfffgrnhhivghlucfuhhgrhhgrfhdfuceougdrshes uggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenucfrrghrrghmpehmrghilhhfrhhomh epugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvnecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-509-ge3ec61c-fmstable-20191030v1 Mime-Version: 1.0 Message-Id: <6dd17886-7097-4f7f-b254-f17ef861abf4@www.fastmail.com> In-Reply-To: <95142696-7C02-4969-8F55-719FEAF646D8@dana.is> References: <20191102055423.5gzbipni3vnjo4k3@tarpaulin.shahaf.local2> <4D918504-B8F4-46D5-9F04-8B223A56FDEE@dana.is> <95142696-7C02-4969-8F55-719FEAF646D8@dana.is> Date: Sat, 02 Nov 2019 07:45:27 +0000 From: "Daniel Shahaf" To: zsh-workers@zsh.org Subject: Re: [PATCH] Completion: Add _log_priorities, _logger Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable dana wrote on Sat, 02 Nov 2019 06:58 +00:00: > On 2 Nov 2019, at 01:45, dana wrote: > > That would definitely work, and be easy to parse, though it is a bit= > > unattractive, especially given how these functions are often called.= >=20 > Oh, i realised with your *very* first suggestion, the quoting wouldn't= be > quite as bad: >=20 > '--foo=3D[specify foo]: :_my_type -Y-a -Y"my optarg" -Y-bcd' >=20 > Though it's certainly strange in a different way. Strange how? I think it's pretty intuitive: to call =C2=AB_foo "$bar[@]= "=C2=BB, write =C2=AB_foo -Y"${^bar[@]}"=C2=BB (?). This is: - Completely generic: it doesn't depend on the value of =C2=AB"${bar[@]}= "=C2=BB, whether it uses single-letter options or GNU-style long options or anything else. - Composable: it's trivial to pass -bcd through _two_ layers of these wrappers, should that ever be necessary. (Example: pdebuild(1) calls dpkg-buildpackage(1) which in turn calls dpkg-genbuildinfo(1), and it's possible to pass dpkg-genbuildinfo(1) arguments to pdebuild(1).) - Requires no new code to implement. It's simply a repeatable option whose optargs are collected in an array. Both zparseopts and _argumen= ts already support this. > It would be cool if there was a convenient way to just have a general = prefix > for options, so that this kind of thing would work: >=20 > '--foo=3D[specify foo]: :_my_type -Ya "my optarg" -Ybcd' >=20 > (The point being that (a) you don't have to repeat the hyphens and (b)= it > knows that "my optarg" is an argument to the type function's -a.) >=20 > Maybe zparseopts could be extended to do that somehow, if it's not too= silly > of an idea. *nod* Cheers, Daniel