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

Re: Completion function for bitkeeper?



On 14 Nov, Danek Duvall wrote:
> 
> > Having $expl stuff added after the first word is exactly the behaviour
> > that is wanted in virtually 100% of all cases.
> 
> So let me ask, what am I doing wrong that makes me believe that I don't
> want it in my case?  Is there a conventional way of passing arguments to
> an action helper function and not getting them mixed up with arguments
> intended for compadd?  Is there functionality I'm missing because I'm
> not doing the conventional thing?

You're not doing something wrong so much as different. Firstly, the
most common case is that there are no options other than compadd
options to get mixed up with so having $expl added is what is wanted.

You wanted the compadd options after your own extra option because it
made it easier to find your option--it would always be the first one.
That made your helper function simpler but puts the onus on the calling
functions to get the options in the right order.

Normally, we put the onus on the helper function to sort out mixed up
options and we have zparseopts to make the job easy. That's better in
my opinion. If you found a Unix program which had two independent and
unrelated options -a and -b and the program couldn't cope with them
being specified in the order -b followed by -a, you wouldn't think it
was very good would you?

Does that make sense?

Oliver 



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