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

Re: PATCH: Make _xset complete more helpfully

On 12 May 2011 19:22, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 12, 10:14am, Bart Schaefer wrote:
> }
> }      27 [[ "$_type$_noprefix" = options && ! -prefix [-+]* ]] && \
> }      28     zstyle -T ":completion:${curcontext}:options" prefix-needed &&
> }      29         return 1
> }
> } I'm not sure it's correct for it to entirely punt when prefix-needed
> } is not defined.  Probably the right thing would be to assume a default
> } value instead ... but I don't really know.
> Ah.  Seems punting when not defined is equivalent to assuming a default
> value of "true":
>     For command options, this means that the initial `-', `+', or `--'
>     must be typed explicitly before option names will be completed.
> So changing _xset to use -O instead *is* the correct fix.

Okay, I'll commit that then. So this means passing -o and non-option
arguments is incorrect, as it is quite hard to type the leading - of a
word that starts with a letter? Reading the man page entry for
_describe I get the impression it is supposed to show non-option
arguments only as long as you don't type a -, not show nothing until
you do... (I don't want this behaviour either for _xset though, as I
said earlier).

Mikael Magnusson

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