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

Re: completion match ordering



On Mon, 2018-11-26 at 02:25 +0100, Oliver Kiddle wrote:
> On 7 Nov, I wrote:
> > 
> > You can do:
> >   _arguments '-b-:level: compadd "${(@)expl/#-J/-2V}" ${(on)levels}'
> > But what you have is perhaps better, especially as it's duplicated for
> > -b and -e.
> The patch below is an initial experiment for what I was suggesting.
> It allows, e.g:
>   _arguments '-b-:level:compadd -o numeric -a levels'
> 
> Any thoughts on the interface? Is something more terse like -on
> preferable? The -V option becomes superfluous (but remains for
> compatibility). Instead of -V grp you can use -J grp -o nosort.

Thanks, this certainly looks useful.

Terseness has it's uses --- some of the completion syntax would be very
wordy otherwise --- but I think spelling it out is reasonable here.

> Do we need to worry about this breaking uses of the old -o?

Ideally, I suppose, yes, even if it's not widely used.  The more obscure
the use, the harder to track down if it does break something...

pws



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