From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13102 invoked by alias); 19 Sep 2015 19:27:42 -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: 36556 Received: (qmail 25750 invoked from network); 19 Sep 2015 19:27:40 -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: 7bit Subject: [PATCH] complete two or more options for zsh Message-Id: Date: Sun, 20 Sep 2015 04:27:31 +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: 55848 % zsh - This offers zsh's options, but the following does not work: % zsh -v - Here, -v can be any other option. The reason seems to be that all the optspecs generated by _argument -- '*:' (_sh: line 24) look like -v[equivalent to --verbose]: --aliases: etc. i.e., a ':' is appended to their ends (so the option requires an argument). This ':' is added by cache+=( "${(@)^tmp}${descr}" ) (_arguments: line 282) where $descr is equal to ':', which comes from the helpspec '*:' passed to _arguments. Not specifying a helpspec at all seems to fix the problem. Or using '*' or '*: : ' as a helpspec seems to work as well. BTW, the description of _arguments in zshcompsys manpage says: The special case of `*:' means both message and action are empty, which has the effect of causing options having no description in the help output to be ordered in listings ahead of options that have a description. But even with '*:' options without description are listed after those with description (and it has a side effect that ':' is appended to the generated optspecs). Are there any ways to control the order of listing? diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh index 21ebfc3..1b51122 100644 --- a/Completion/Unix/Command/_sh +++ b/Completion/Unix/Command/_sh @@ -24,6 +24,6 @@ fi local ret=$? -[[ $service == zsh ]] && _arguments -S -s -- '*:' && ret=0 +[[ $service == zsh ]] && _arguments -S -s -- && ret=0 return ret