Zsh Mailing List Archive
Messages sorted by:
Re: Completion function for bitkeeper?
- X-seq: zsh-users 6781
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Danek Duvall <duvall@xxxxxxxxxxx>
- Subject: Re: Completion function for bitkeeper?
- Date: Mon, 17 Nov 2003 16:47:40 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20031114154608.GA6959@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030523160020.GA9026@xxxxxxxxx> <20030523160155.GA14388@xxxxxxxxxxxxxxxxxx> <20031106153225.GA491@xxxxxxxxxxxxxxxxxx> <1281.1068232665@athlon> <20031110182013.GA20547@xxxxxxxxxxxxxxxxxx> <9219.1068538977@xxxxxxxxxxx> <20031111162338.GD23138@xxxxxxxxxxxxxxxxxx> <901.1068577572@athlon> <20031111212828.GA28125@xxxxxxxxxxxxxxxxxx> <29114.1068797096@xxxxxxxxxxx> <20031114154608.GA6959@xxxxxxxxxxxxxxxxxx>
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?
Messages sorted by: