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

Re: current CVS test failure



On 30 Apr, Peter wrote:
> Oliver Kiddle wrote:
> > The test is doing _arguments '-+o'. Because there are no other
> > (non-option) things being completed, it adds the -o and +o regardless
> > of the prefix. In _describe, I can't know if _arguments is completing
> > other things so I can't think of any easy solution other than checking
> > prefix-needed manually in any other function using _describe -o.
> 
> how about adding another option to _describe e.g. -O which works the
> same but doesn't test prefix-needed and only gets called from
> _arguments?

I couldn't think of a particularly better solution. A nasty hack would
involve looking at $compstate[nmatches] to see if anything else had
been completed but you can't rely on the options be completed after
whatever else. postfunctions aren't much use because they are run too
late after all the completers. In some respects prefix-needed is
actually redundant because the same can be achieved with the
ignored-patterns style.

So your -O is probably the best solution.

Oliver



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