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

Re: completion, sorting of options



On Wed, Nov 8, 2023 at 5:25 AM Thomas Lauer <thomas.lauer@xxxxxxxxxx> wrote:
>
> Apparently there's no obvious solution to the zstyle "sort false/nosort"
> thing.

The short answer here is that you can't do this with a single call to
_arguments.  The option parsing in _arguments creates two lists, one
of options that don't take values and one of options that do, and
subsequently it passes them to compadd in two separate calls, so
compadd sees them in that order even though _arguments does not.

The "simplest" thing to do here might be to make an array of the
options that must be in a particular order, and then loop that array
calling _arguments once for each, and then make a final call to
_arguments with all the other specs.

> zstyle ':completion:*:*:mycmd:*:*' sort nosort_and_i_really_mean_nosort

Not likely to happen as it would mean a significant change to the deep
guts of _arguments.




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