Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion using state-machine


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

So I guess I really need to understand how to use the -> states.  Regards,


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