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

Re: starting completions with =,<,>



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