From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26863 invoked from network); 3 Mar 2005 13:37:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Mar 2005 13:37:02 -0000 Received: (qmail 95634 invoked from network); 3 Mar 2005 13:36:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Mar 2005 13:36:56 -0000 Received: (qmail 9945 invoked by alias); 3 Mar 2005 13:36:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20923 Received: (qmail 9932 invoked from network); 3 Mar 2005 13:36:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Mar 2005 13:36:53 -0000 Received: (qmail 95254 invoked from network); 3 Mar 2005 13:36:50 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 3 Mar 2005 13:36:45 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-11.tower-36.messagelabs.com!1109857004!14604795!1 X-StarScan-Version: 5.4.11; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 6471 invoked from network); 3 Mar 2005 13:36:44 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-11.tower-36.messagelabs.com with SMTP; 3 Mar 2005 13:36:44 -0000 Received: from trentino.logica.co.uk ([158.234.142.59]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id j23Dah61021725; Thu, 3 Mar 2005 13:36:43 GMT Received: from trentino.groupinfra.com (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 40C383AFBC; Thu, 3 Mar 2005 14:36:23 +0100 (CET) Cc: zsh-workers@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <200503022019.52992.hak8@wp.pl> From: Oliver Kiddle References: <200503022019.52992.hak8@wp.pl> To: Henryk Konsek Subject: Re: _unace MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <32022.1109856976.0@trentino.groupinfra.com> Date: Thu, 03 Mar 2005 14:36:23 +0100 Message-ID: <32033.1109856983@trentino.groupinfra.com> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32022.1109856976.1@trentino.groupinfra.com> Henryk Konsek wrote: > I've written completion file for the unace command. Its syntax is very Thanks for this. > similar to the unrar command so I've used part of _rar as a pattern while > creating it. This is my first completion file so I would be grateful for any > comments. I'll put a few comments below. > if (( CURRENT == 2)); then You can actually do this from _arguments directly which has the advantage that it will then complete unace commands after any switches. You do this by starting an _arguments specification with a number. For example: '1:unace command:((e\:extract\ files l\:list\ archive))' The final component of that lets you specify what to complete. The syntax above with the descriptions is similar in effect to your use of _values. > '-c\ [Show comments]' \ What is the `\ ' in there for? > '-p\[Set ]' \ If a password is defined after the -p switch, you can use this: '-p[specify password]:password' \ It then knows to prompt for a password to be completed after -p. If the password should be imediately after the `-p' (as with unace) then use a `+': '-p+[specify password]:password' \ > '*:files:_files -g \*.rar\(-.\)\' \ Don't you mean to complete .ace files instead of .rar? Also, looking at the output of unace -h, there is also a -x option for excluding files. It also looks like it should actually complete archive (.ace) files in the second argument position only and then complete files from within the archive. _zip does something similar if you want to have a look. Also from the unace -h output, it looks like the options need a trailing `-' or `+' to indicate enabled or disabled. It says: (default) c[-] Show comments (+) f[-] Full path matching (-) o[-] Overwrite files (-) Can the defaults be changed? If not, we could just use something like: '-c\-[show comments]' \ '-f\+[full path matching]' \ If the defaults are configurable, we may need: '-c+[show comments]:enable:(- +)' \ Or have I misunderstood the output of unace -h? I've attached an updated version of _unace. I've not actually got any .ace files to test it on so you can still improve it in some of the ways I've mentioned. Oliver ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="_unace"; charset="us-ascii" Content-ID: <32022.1109856976.2@trentino.groupinfra.com> #compdef unace _arguments -S \ '-c[show comments]' \ '-f[full path matching]' \ '-o[overwrite files]' \ '-p+[specify password]:password' \ '-y[assume yes on all queries]' \ '-x+[specify files to exclude]:files' \ '-h[print help information]' \ '1:unace command:(( e\:extract\ files l\:list\ archive t\:test\ archive\ integrity v\:list\ archive\ \(verbose\) x\:extract\ files\ with\ full\ path ))' \ '*:files:_files -g "*.ace(-.)"' ------- =_aaaaaaaaaa0--