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

Completing multiple states with _arguments



Hi!

How do I deal with multiple states when completing with _arguments?

local context state line
typeset -A opt_args

_arguments \
  ':: :->something-optional-before-files' \
  '*:: :->file' && ret=0

# Now what?

The documentation doesnât give an example, neither does the book, and
I was unable to find an example under Completion in the source tree.

Iâm updating the git-diff completion (along with all the other git-*
completions), if you want a more specific example.  Git diff can take
two arguments that may be commits, trees, or blobs before it takes any
file arguments.

Thanks!



Messages sorted by: Reverse Date, Date, Thread, Author