From: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
To: zsh-workers@sunsite.dk
Subject: RE: _arguments description problem
Date: Mon, 15 Apr 2002 12:36:57 +0400 [thread overview]
Message-ID: <002801c1e458$b535a010$1fc1f2a3@mow.siemens.ru> (raw)
In-Reply-To: <15546.34631.878469.111142@wischnow.berkom.de>
>
> 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
next prev parent reply other threads:[~2002-04-15 8:37 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 [this message]
2002-04-15 8:51 ` Sven Wischnowsky
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='002801c1e458$b535a010$1fc1f2a3@mow.siemens.ru' \
--to=andrej.borsenkow@mow.siemens.ru \
--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).