From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7000 invoked from network); 9 Jan 2003 17:08:07 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Jan 2003 17:08:07 -0000 Received: (qmail 4517 invoked by alias); 9 Jan 2003 17:08:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18069 Received: (qmail 4502 invoked from network); 9 Jan 2003 17:08:01 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-20.tower-4.messagelabs.com!1042132044!40843 X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk In-reply-to: <6134254DE87BD411908B00A0C99B044F04D69127@MOWD019A> From: Oliver Kiddle References: <6134254DE87BD411908B00A0C99B044F04D69127@MOWD019A> To: zsh-workers@sunsite.dk Subject: Re: Passsing descriptions down in completion functions Date: Thu, 09 Jan 2003 18:09:51 +0100 Message-ID: <503.1042132191@finches.logica.co.uk> Sender: kiddleo@logica.com On 9 Jan, you wrote: > > Well, I started to look into these functions and immediately hit some > problems: > > AIX/Type/_object_classes: > > _wanted objectclasses expl 'object class' \ > _files -W ${ODMDIR:-/etc/objrepos} -g '^*.vc' > > Here is just no place where I could stuff the magic "-". Granted, this one > does not pass arguments it receives but in general I do not see why it > should not do it. I think you can put the "-" on the end of the line like this: _wanted ... \ _files -W ${ODMDIR:-/etc/objrepos} -g '^*.vc' "$@" - > Base/Utility/_sub_commands > > if [[ CURRENT -eq 2 ]]; then > _wanted commands expl command compadd "$@" > else > _message 'no more arguments' > fi > > almost the same problem. In this case arguments contain both description and > matches so I have no way to stuff "-" in between. That's a slightly unusual case because any matches passed to _sub_commands could be thought of as not being arguments to compadd to be passed on in the traditional sense. It is probably best handled by passing a "-" in the calling function. I agree that this isn't particularly ideal though. I remember Sven saying something about rethinking the way compadd options are passed but I was mostly thinking in terms of suffixes and not descriptions. It'd be wise to think in terms of all the compadd options and how they are passed around in coming up with a good solution. A variant of your _all_labels suggestion is perhaps not a bad idea. I'd want to be able to override any passed descriptions in some cases. 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.