From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20411 invoked by alias); 21 Sep 2015 13:07:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36578 Received: (qmail 9145 invoked from network); 21 Sep 2015 13:07:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [PATCH] compsys.yo: key in $opt_args if the option is in one of mutually exclusive sets Message-Id: <7EEFB2B4-A2F1-44BE-AFFB-96B3CD234B35@kba.biglobe.ne.jp> Date: Mon, 21 Sep 2015 22:06:51 +0900 To: zsh-workers@zsh.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 63717 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. =20 +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