zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: RE: _arguments description problem
Date: Mon, 15 Apr 2002 10:51:56 +0200	[thread overview]
Message-ID: <15546.38060.875899.640365@wischnow.berkom.de> (raw)
In-Reply-To: <002801c1e458$b535a010$1fc1f2a3@mow.siemens.ru>


Borsenkow Andrej wrote:

> ...
> 
> 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? 

That wouldn't be much cleaner, actually, because there would have to
be an option to select or de-select this behaviour because we don't
always want it -- at least I know that I wrote some functions where I
intentionally didn't use `-', in cases where the lower level functions
just knew better what to produce as descriptions.

So that is one case where just counting lines gives wrong results. Two
other cases are: functions that are not intended to be used as helper
functions (and those are responsible for many of the uses of _wanted)
and cases where the `-' might be on a second line. I don't know how
many cases fall into the second category, but a bit of grep and wc
shows 131 cases where the line with _wanted ends in a backslash.


But of course, anyone is free to hack on the completion code -- always
was. The best place would probably be _all_labels, the place where we
now do the search for `-'. And make sure to check the uses of _wanted
so that we don't use stuff we want to have.


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


      reply	other threads:[~2002-04-15  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-14 10:09 Borsenkow Andrej
2002-04-15  7:54 ` Sven Wischnowsky
2002-04-15  8:36   ` Borsenkow Andrej
2002-04-15  8:51     ` Sven Wischnowsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15546.38060.875899.640365@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).