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: Sun, 25 Jul 2004 14:39:38 -0700	[thread overview]
Message-ID: <pan.2004.07.25.21.39.37.858165@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0407250838430.7539@toltec.zanshin.com>

On Sun, 25 Jul 2004 10:42:38 -0700, Bart Schaefer wrote:


> Unless you "unsetopt equals" this could potentially be expanded into
>
> emerge -p /usr/local/bin/zsh-4.2.0-r1
>
> (or the like).  That's why there's the "-equals-" completion context.

Yes, I saw that, it's in my example under the compdef header. Is it
-equal- or -equals- though? And are there any examples of this anywhere? I
saw that _bzip2 uses -redirect-, but it wasn't obvious how to apply that
to my situation with -equal-. There doesn't seem to be any command that
does use -equal-, that I've found.

>> I saw in the manpage that _values does not support the equal sign.
> 
> Can you quote the bits of the manual that made you think this?
>
>
Sure, the man page for zshcompsys says this under _values 6th paragraph

  All other arguments describe the possible values and their arguments 
  in the same format used for the description of options by the _arguments
  function (see above).  The only  differences  are that  no minus or plus
  sign is required at the beginning, values can have only one argument,
  and the forms  of  action  beginning with an equal sign are not
  supported.

I'm probably reading it wrong, though.

> In any event I don't think you want _values.  The _values function is
> for words of the form <name><sep><value> where <sep> defaults to "=",
> e.g. "foo=bar" (like an assignment).  You can tell it to use a different
> <sep>, but in the case of emerge there doesn't appear to be a <name>
> part.

Exactly, there is no <name>, just a <value>.
 
> The problem here is that you're trying to treat this as an option, when
> what you need to do is treat it as an argument.  The question is whether
> it is a stand-alone argument, or whether it's an argument that must
> follow the -p option?  I haven't been able to dig up any documentation
> on emerge (the only software I can find are a mass-mailing program and
> the emacs CVS interface -- everything else is lost in the Google noise
> because "emerge" is a real word).

Sorry for not being more clear. Emerge is the gentoo linux install
command. You can find out more about gentoo at www.gentoo.org.  There is a
manpage here: http://re.a.la/man/emerge/ What I am trying to add is listed
under the ebuild and dependency headers.

This could be a standalone argument, or it could follow one or more other
arguments (-p, --pretend, --update, etc...). 
emerge -p =gvim-6.3
emerge  =gvim-6.3
emerge --pretend --deep --buildpkg =gvim-6.3 
All valid commands as far as emerge is concerned.

The existing emerge completion is here: 
http://cpan.cybercomm.nl/pub/gentoo-portage/app-shells/zsh/files/_portage

If I insert this snippet (along with the _portage_ebuilds from my previous
example) into the above completion, --pretend works and lists all the
appropriate files, while = lists the normal ones.
 
 =|--pretend)
  _arguments -s \
     '*:install version:_portage_ebuilds' "$common_args[@]" && return 0
		;;

And just to clarify, I want regular emerge without an equal sign to
complete one list (fvwm, zsh, abiword...) and the emerge = to complete
exact versions (fvwm-2.5.10-r6, fvwm-2.4.18, zsh-4.2.0-r1, ...). So I
can't just replace the default behavior with the versioned packages.

Hope that clears things up. Thanks for looking at this.


  reply	other threads:[~2004-07-25 21:37 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 [this message]
2004-07-26 13:06     ` chris s
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.25.21.39.37.858165@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).