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

Re: return code of _arguments

On Mar 23, 11:33pm, Oliver Kiddle wrote:
} Subject: return code of _arguments
} If my understanding is correct the test [[ $? = 300 ]] after _arguments
} is going to be equivalent to the test [[ -n $state ]]?

I suggested getting rid of the 300 return code once before.

Back in zsh-workers/12475, Sven wrote:
> No. The special return value is used by the wrappers around _arguments 
> such as _x_arguments. And there we *need* to be able to distinguish
> the cases (to keep the special parameters from being reset).
> And anyway, the problem is not with the return value, since, as you
> observed, we use $state for tests anyway. The problem is that with
> ->state actions _arguments may have to generate matches (the options)
> and it can't know if the caller adds more matches. What I wanted is an 
> easier way for calling functions to distinguish this from the case
> where _arguments generates real matches (by executing one of the other 
> forms for actions). Currently this can be done by relying on the
> return value to test if `real' matches (not only options) were
> generated and then use $state to find out if a state has to be handled 
> and *there* use $compstate[nmatches] to find out if options were
> completed. If needed, and it is seldom needed because in most cases
> the state doesn't have to be handled in a loop.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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