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

Re: Completion using state-machine



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