From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3749 invoked from network); 15 Apr 2002 08:37:27 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Apr 2002 08:37:27 -0000 Received: (qmail 1616 invoked by alias); 15 Apr 2002 08:37:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16984 Received: (qmail 1605 invoked from network); 15 Apr 2002 08:37:20 -0000 From: Borsenkow Andrej To: zsh-workers@sunsite.dk Subject: RE: _arguments description problem Date: Mon, 15 Apr 2002 12:36:57 +0400 Message-ID: <002801c1e458$b535a010$1fc1f2a3@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: <15546.34631.878469.111142@wischnow.berkom.de> x-mimeole: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal > > Borsenkow Andrej wrote: > > > ... > > > > Which means that _wanted (and related functions) probably needs some way > > to know if it needs to setup description or not. I wonder, does it make > > sense to parse arguments (in this case "$@" -k userdirs) and if standard > > completion options are already there, do not override them? Seems like > > the least intrusive solution. > > Actually, I have already added a mechanism for that, see the > description for _all_labels in the docs (which is referred to under > _requested, which is referred to under _wanted). If the command-args > given to any of these functions contains a `-', the options are added > before it, if the hyphen is the last argument, it is replaced with the > options. And since latter options override earlier onces for compadd, > clean functions should probably use things like: > I would not call this really clean :-) It is a workaround I admit but not a really clean solution. > _wanted users expl user compadd "$@" -k userdirs - > > (note the added `-' at the end) > > But I have to admit that I always forget to do that, too. Sorry. > bor@itsrm2% grep -r _wanted | wc -l 300 bor@itsrm2% grep -r _wanted | grep -- ' - ' | wc -l 26 so over 90% of all functions do not use it. I really believe that cleaner and better way would be to parse options. Is it possible to do it in one place only? -andrej