From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24285 invoked from network); 11 Feb 2003 08:08:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Feb 2003 08:08:54 -0000 Received: (qmail 27573 invoked by alias); 11 Feb 2003 08:08:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5907 Received: (qmail 27566 invoked from network); 11 Feb 2003 08:08:17 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Feb 2003 08:08:17 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.147] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Feb 2003 8:8:16 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1044950658!325 Received: (qmail 1835 invoked from network); 11 Feb 2003 08:04:18 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-3.tower-27.messagelabs.com with SMTP; 11 Feb 2003 08:04:18 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id IAA17529; Tue, 11 Feb 2003 08:08:10 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h1B8BTU07852; Tue, 11 Feb 2003 09:11:29 +0100 cc: Zsh Users List In-reply-to: <3E3EF1BF.8040403@progress.com> From: Oliver Kiddle References: <3E3EF1BF.8040403@progress.com> To: Bill Burton Subject: Re: Completing on options in name=value format? Date: Tue, 11 Feb 2003 09:11:28 +0100 Message-ID: <7850.1044951088@finches.logica.co.uk> Sender: kiddleo@logica.com On 3 Feb, Bill Burton wrote: > I'm writing a completion function for some home grown scripts that > require options in the format name=value. I'm having two problems with > my function: > > The command is as follows with the area and pf options required but the > test option is not: > startws area= \ > pf= the directory completed in the area option> > test={yes|no} > > In order to complete the pf option, the area option must be specified first. > > The function mostly works but I still have the following issues: > > 1. After I complete on the area= option, it still shows up on the > completion menu. In zsh 4.1 there is a -w option to _values that will fix this. _values isn't as good as I'd like. The issues were discussed in depth in relation to _dd if you want to search the archives for it. > 2. The .pf suffix for the filename on the pf option isn't stripped off. I think you've misunderstood what -s to compadd does. -W and -g are options to _files and not compadd. How you should write it depends on whether you want to complete subdirectories along with .pf files. If not, compadd ${BASEDIR:-/usr/local}/${area}/conf/*.pf(:r:t) should do it. > 3. After completing an option and its argument, there's an extranious > "=" appended to the end: That's what you told it to do in the line: compadd -qS = -a area_dirs At least in 4.1, your -s = argument to _values is redundant. -S specifies the separator between values and their arguments (default =) while -s specifies the value separator. Oliver This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.