Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: starting completions with =,<,>
- X-seq: zsh-workers 20197
- From: chris s <oberyno@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: starting completions with =,<,>
- Date: Mon, 26 Jul 2004 06:06:54 -0700
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <pan.2004.07.25.11.42.39.666502@xxxxxxxxx> <Pine.LNX.4.61.0407250838430.7539@xxxxxxxxxxxxxxxxxx> <pan.2004.07.25.21.39.37.858165@xxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Ok, I was looking more into this, and it turns out the bash completion is
able to handle =, >=,<=. The bash person did this:
local cur curword numwords compwords opts cond prepend
....
cur="${COMP_WORDS[COMP_CWORD]}"
....
# Check for conditional.
cond="${cur%%[A-Za-z0-9]*}"
cur="${cur:${#cond}}"
[[ "${cond:0:1}" == "'" ]] && prepend="-P ${cond:1}"
# Handle cases where a conditional is specified.
if [[ "${cond}" ]]; then
if [[ "${cur}" ]]; then
if [[ "${cur}" == */* ]]; then
...
and it seems to work. FYI, the bash completion for emerge is at
http://sourceforge.net/projects/gentoo-bashcomp/
Anyway, I think I'm going to completely rewrite the zsh emerge completion
to handle this sort of thing. In the above code, all I would have to do to
make it zsh compatible would be change $COMP_WORDS variable to $words and
$COMP_CWORD to $CURRENT , right? And prepend would be compadd -P?
Thanks for your help.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author