zsh-users
 help / color / mirror / code / Atom feed
From: Larry Schrof <larrys@fb.com>
To: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Having a tough time setting up completion.
Date: Thu, 15 Dec 2011 22:06:58 +0000	[thread overview]
Message-ID: <CB0FAF82.2D15%larrys@fb.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

I've spent a lot to time studying the zshcompsys man page (the docs for _arguments specifically), but I"m still having a tough time specifying the syntax to do the following completion.

I have a command called foo. This command takes exactly one of three forms:

foo  -x  <exactly-one-of-fifty-strings>
foo --longword <exactly-one-of-fifty-strings>
foo <exactly-one-of-fifty-strings>

-x is a single-letter option, --longword is a double-dashed GNU-style long option. (These two options are synonymous.) Of these two options, either zero or exactly one of them should appear. IF one of them appears, it must appear immediately after foo (separated from foo, of course, by whitespace).

In all cases, <exactly-one-of-fifty-strings> is a single (non-leading-dash) word. As soon as this word is entered or completed, no other word from the (really large) set should appear on the command line.

If anyone can offer a general outline as to how I can use _arguments to implement this, that would be great. I need to manually enter in all fifty words at some point, and make them mutually exclusive. Will be interesting to see how to do that. Thanks!




             reply	other threads:[~2011-12-15 22:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 22:06 Larry Schrof [this message]
2011-12-15 22:54 ` Mikael Magnusson
2011-12-16  0:17   ` Larry Schrof
2011-12-16  3:46     ` Bart Schaefer

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=CB0FAF82.2D15%larrys@fb.com \
    --to=larrys@fb.com \
    --cc=zsh-users@zsh.org \
    /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).