Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion, sorting of options
- X-seq: zsh-users 29331
- From: Thomas Lauer <thomas.lauer@xxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: completion, sorting of options
- Date: Thu, 09 Nov 2023 13:32:27 +0000
- Archived-at: <https://zsh.org/users/29331>
- In-reply-to: <CAH+w=7bXRSr+8Q9F7YG2-smroT_ZaUU08kuWx=CJb7CzT2_54g@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Organization: TL
- References: <3focki1mdsq59ji5d0u5nb7qenu6u8brkt@tlc.com> <dp2nkithdenet27dghfagsl8r02q4l3irt@tlc.com> <CAH+w=7bXRSr+8Q9F7YG2-smroT_ZaUU08kuWx=CJb7CzT2_54g@mail.gmail.com>
From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
Date: Wed, 8 Nov 2023 12:09:20 -0800
> 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.
As the :-) in my message showed (or perhaps didn't) this was not really
a serious suggestion. It's just a bit frustrating that what I'd call an
implementation detail within _arguments makes this call perform in a way
a (probably naive) user doesn't expect and can't easily grok or rectify.
Anyway, thanks for the clarification. T
Messages sorted by:
Reverse Date,
Date,
Thread,
Author