From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1645 invoked from network); 12 Feb 2004 09:18:24 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Feb 2004 09:18:24 -0000 Received: (qmail 6949 invoked by alias); 12 Feb 2004 09:18:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7040 Received: (qmail 26800 invoked from network); 12 Feb 2004 07:03:04 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Feb 2004 07:03:04 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [207.71.22.228] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Feb 2004 7:3:3 -0000 Received: from elm.teratorn.org (unknown [10.0.0.23]) by oak.teratorn.org (Postfix) with ESMTP id E6124400 for ; Thu, 12 Feb 2004 01:30:42 -0600 (CST) To: zsh-users@sunsite.dk Subject: short option and long option completion formatting From: Eric Mangold Content-Type: text/plain; format=flowed; charset=iso-8859-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Wed, 11 Feb 2004 22:58:08 -0700 Message-ID: User-Agent: Opera7.23/Linux M2 build 518 Hello folks, I'm writing completion functions and I've come across a formatting issue. The commands I'm doing completions for have a number of short options and matching long options (such as -p and --port). The way I'm doing it now, using _arguments, is to have a seperate spec for the short options and the corresponding long options. These specs are, of course, virtually identical and when _arguments formats the output on screen they show up on seperate lines, such as: --bar -- Description of bar --baz -- Description of baz --foo -- Description of foo -a -- Description of A -b -- Description of bar -f -- Description of foo I want a way to combine these specs so as not to duplicate "code" and a way to format this all on one line, such as: -a -- A description -b, --bar -- Description of bar -f, --foo -- Description of foo --baz -- baz description I find this formatting quite a bit more readable especially as the number of options increases. I've done some searching on the ML archives and poking around the official completion functions and havn't found anything related. I'm really new to writing completions and looking for help. Any ideas on how to implement this? Thank you, -Eric Mangold -PS By the way, the commands I'm doing completion for are twistd and mktap of the Twisted project. use their --help options to see how that gets formatted (very close to what I want the completion to look like). Or if anyone is curious about how it looks and doesn't want to install Twisted I shall respond with that info.