zsh-workers
 help / color / mirror / code / Atom feed
From: chris s <oberyno@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Re: starting completions with =,<,>
Date: Mon, 26 Jul 2004 06:06:54 -0700	[thread overview]
Message-ID: <pan.2004.07.26.13.06.54.327306@gmail.com> (raw)
In-Reply-To: <pan.2004.07.25.21.39.37.858165@gmail.com>

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.


  reply	other threads:[~2004-07-26 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-25 11:42 chris s
2004-07-25 17:42 ` Bart Schaefer
2004-07-25 21:39   ` chris s
2004-07-26 13:06     ` chris s [this message]
2004-07-26 13:59       ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2004.07.26.13.06.54.327306@gmail.com \
    --to=oberyno@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).