Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Completion: Add _log_priorities, _logger
- X-seq: zsh-workers 44887
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Completion: Add _log_priorities, _logger
- Date: Sat, 02 Nov 2019 07:45:27 +0000
- 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==
- In-reply-to: <95142696-7C02-4969-8F55-719FEAF646D8@dana.is>
- 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: <E00A62F9-627E-4C0C-A3FD-3A0C1F00D666@dana.is> <20191102055423.5gzbipni3vnjo4k3@tarpaulin.shahaf.local2> <4D918504-B8F4-46D5-9F04-8B223A56FDEE@dana.is> <95142696-7C02-4969-8F55-719FEAF646D8@dana.is>
dana wrote on Sat, 02 Nov 2019 06:58 +00:00:
> On 2 Nov 2019, at 01:45, dana <dana@xxxxxxx> wrote:
> > That would definitely work, and be easy to parse, though it is a bit
> > unattractive, especially given how these functions are often called.
>
> Oh, i realised with your *very* first suggestion, the quoting wouldn't be
> quite as bad:
>
> '--foo=[specify foo]: :_my_type -Y-a -Y"my optarg" -Y-bcd'
>
> Though it's certainly strange in a different way.
Strange how? I think it's pretty intuitive: to call «_foo "$bar[@]"»,
write «_foo -Y"${^bar[@]}"» (?). This is:
- Completely generic: it doesn't depend on the value of «"${bar[@]}"»,
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 _arguments
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:
>
> '--foo=[specify foo]: :_my_type -Ya "my optarg" -Ybcd'
>
> (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.)
>
> Maybe zparseopts could be extended to do that somehow, if it's not too silly
> of an idea.
*nod*
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author