Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion using state-machine
- X-seq: zsh-users 12525
- From: "Marco Lombardi" <marco.lombardi@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Completion using state-machine
- Date: Thu, 31 Jan 2008 18:03:28 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Ctnv2zJ9PIoZPnR8JEOjIEJgbC0qu+2k9Hq0AhV2d08=; b=jsxdzmCfXBMV0mxj4jO41kG3Po3E3TBefNNaQaeNKlIRMN1OFO8jxuFLWc+BZ9HSkS2XNJhp4P2aoivwt+5m2uCXsBa+PyJl3qrOLgTIQ2uOJ/icv5pHlr0tRekzYbqqUqhuV2fvQtzLP2J4+G0KAZnqyl1JWIPMMzbtBg+JSfY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=B61FD/4N63+qLyAsTv7i8wyFD7+j1CbHO2DnfSNh9Z6tbCrOs5jvaq4dtaS2LeC7wJjP/ESI1KNIWz49ufaRjN1DeK2LXuYsiJtMNt+5N2LPpex+KZDL++hElVW+18IPvpMRz4QI54ak/peWzTbQXC1NWbXbk613dl0Y9i7/sD0=
- In-reply-to: <20080131162632.GB3266@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <840a25630801310228k7dd39656t85754f3cb4fee8cf@xxxxxxxxxxxxxx> <20080131162632.GB3266@xxxxxxxxxxx>
Hi,
many thanks for the answer, but unfortunately what I need cannot be
easily done as you suggest. I am actually concerned about option
orders (two --parameter's options without a --path in between are not
acceptable); in addition, I want at most three --verbose options, no
more.
So I guess I really need to understand how to use the -> states. Regards,
Marco
On Jan 31, 2008 5:26 PM, Clint Adams <clint@xxxxxxx> wrote:
> On Thu, Jan 31, 2008 at 11:28:55AM +0100, Marco Lombardi wrote:
> > {-v,--verbose} - increase verbosity of messages, can be used up to three times
> > {-s,--simple} - simple flag, can be used only once in the whole line
> > {-p,--path}=PATH - specify a directory (e.g., _files -/) for following commands
> > {--parameter}=PAR - set some specific parameter, can be used once for
> > a specified path
>
> This probably doesn't answer your question, but if you're not strictly
> concerned with option order nd context, you can avoid using a state
> machine and just do something like
>
> _arguments -s \
> \*{-v,--verbose}'[increase verbosity of messages]' \
> '(-s --simple)'{-s,--simple}'[simple flag]' \
> \*{-p,--path=}':directory for following commands:_directories' \
> '*--parameter=:parameter:(1 2 3)'
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author