Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Completion: Add _log_priorities, _logger



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.

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.

dana



Messages sorted by: Reverse Date, Date, Thread, Author