Zsh Mailing List Archive
Messages sorted by:
Re: Completion function for bitkeeper?
- X-seq: zsh-users 6785
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Danek Duvall <duvall@xxxxxxxxxxx>
- Subject: Re: Completion function for bitkeeper?
- Date: Wed, 19 Nov 2003 11:23:26 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20031117175151.GA24060@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <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> <15744.1069084060@xxxxxxxxxxx> <20031117175151.GA24060@xxxxxxxxxxxxxxxxxx>
Danek Duvall wrote:
> As it is, even with zparseopts (which I hadn't known about, so thank you
> for that), there's no way at all to tell whether a -e that's passed to
> my helper function is there because I passed it in explicitly through an
> argument to _arguments, or whether it's part of the set of arguments
> that's destined only for compadd. There's simply no way for me to know.
-e will only ever be there if you passed it explicitly. Though -e is an
option to compadd, it really wouldn't make sense to pass it to a
completion function. So you're safe with -e. Admittedly you would
not be safe had you chosen -x.
> So then the onus is on me to pick a flag that compadd doesn't already
> use. It uses seventeen uppercase letters, thirteen lowercase letters,
> and two numbers, and that's a pretty severe depletion of the usable
> namespace of flags. But assuming I choose one (and it's even remotely
A good few are safe to use: -a, -k, -f, -e, -W and -U are all safe. I'm
not sure about some such as -l, -Q, -C and -E without looking in more
detail. That perhaps should be documented somewhere.
> mnemonic), then there's no guarantee that a future release doesn't add a
> new flag to compadd, and bites me in the ass!
No there isn't but no compadd options have been added in a long while.
We can do a search on distributed functions if we do ever add one.
> So while I understand your explanation, my question of how to do this
> right is still going unanswered.
I think I've now explained how best to do this given the constraints of
the completion system as it currently stands.
I agree that it isn't ideal. The best alternative I can think of would
be to pass compadd options to the various tag handling functions
instead of the completion functions. Tag loops need rethinking anyway
and that isn't a trivial job. Discussion of possible changes to compsys
should go to zsh-workers, though.
Messages sorted by: