zsh-users
 help / color / mirror / code / Atom feed
* Completing multiple states with _arguments
@ 2010-11-09 22:49 Nikolai Weibull
  2010-11-10 10:20 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolai Weibull @ 2010-11-09 22:49 UTC (permalink / raw)
  To: Zsh Users

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!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-10 12:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 22:49 Completing multiple states with _arguments Nikolai Weibull
2010-11-10 10:20 ` Peter Stephenson
2010-11-10 11:23   ` Nikolai Weibull
2010-11-10 12:11     ` Peter Stephenson
2010-11-10 12:37       ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).