Zsh Mailing List Archive
Messages sorted by:
Having a tough time setting up completion.
- X-seq: zsh-users 16641
- From: Larry Schrof <larrys@xxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Having a tough time setting up completion.
- Date: Thu, 15 Dec 2011 22:06:58 +0000
- Accept-language: en-US
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : content-type : mime-version; s=facebook; bh=JC+6g9xg+P5aAoDP8EwvjGag+xCkEbZ5voTgyfX6HLo=; b=fbbZHf/kxCtVWKNFA2gtWxA2T13D3BDUFjalO2pxF5LbIFwXd6jdLFFk4jY37VvVbVJg /j6zs9JB4dp8FwyJ0QeR1L8NJzEEM5Ky9pk5qJCqWm1rM8t+TgHxSJgfQFEcV+aviIhj 0QU41wG4/Dmo0YrIQiEn3trM0uKIRUow7kE=
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Thread-index: AQHMu3XdAqNB7xXbw0yZ5vB/QP2nIQ==
- Thread-topic: Having a tough time setting up completion.
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>
-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!
Messages sorted by: