zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] compsys.yo: key in $opt_args if the option is in one of mutually exclusive sets
@ 2015-09-21 13:06 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2015-09-21 13:06 UTC (permalink / raw)
  To: zsh-workers

If optspecs for the _arguments is grouped into sets of options
as in the example in the zshcompsys manpage:

_arguments -a - set1 -c - set2 -d

and if the option -c is on the command line, then it is added
to the associative array $opt_args with key 'set1--c', i.e.,
'set1-' is prepended to the option. But it seems this is not
documented anywhere.


diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index d067795..d6b1803 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -3982,6 +3982,11 @@ possible completions.  When it contains `tt(-d)' or an argument, the
 option `tt(-c)' will not be considered.  However, after `tt(-a)'
 both sets will still be considered valid.
 
+If an option in a set appears on the command line, it is stored in the
+associative array `tt(opt_args)' with 'var(set)tt(-)var(option)'
+as a key.  In the example above, a key `tt(set1--c)' is used if the option
+`tt(-c)' is on the command line.
+
 If the name given for one of the mutually exclusive sets is of the form
 `tt(LPAR())var(name)tt(RPAR())' then only one value from each set will ever
 be completed; more formally, all specifications are mutually




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-21 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 13:06 [PATCH] compsys.yo: key in $opt_args if the option is in one of mutually exclusive sets Jun T.

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).