From: Borsenkow Andrej <Andrej.Borsenkow@mow.siemens.ru>
To: Sven Wischnowsky <wischnow@berkom.de>
Cc: zsh-users@sunsite.dk
Subject: Re: Completing comma seprated list of option values in _atguments
Date: 25 Feb 2002 12:22:30 +0300 [thread overview]
Message-ID: <1014628956.5254.7.camel@localhost.localdomain> (raw)
In-Reply-To: <15481.64476.314684.446454@wischnow.berkom.de>
On Пнд, 2002-02-25 at 11:54, Sven Wischnowsky wrote:
>
> Borsenkow Andrej wrote:
>
> > I must be entirely stupid but I cannot figure out how to do it. Values
> > must be generated on the fly not chosen from fixed array. And _values
> > seems to want fixed values only :(
>
> Yes, _values is not intended for that, although it depends on how the
> values are generated, of course...
>
> We probably don't need utility functions for everything, simple
> solution, not that nice, but ok when values may appear more than once:
>
I finally ended up with
_urpmi_media() {
local source media brace ret=1 opt
local -a all_sources
local context state line
typeset -A val_args
while read source media brace; do
[[ "$brace" != "{" ]] && continue
all_sources=($all_sources $source)
done < /etc/urpmi/urpmi.cfg
if [[ "$service" == urpmq ]]; then
_values -s , "urpmi media" "$all_sources[@]" && ret=0
else
_wanted urpmi_media expl 'available media' \
compadd "$@" -a -- all_sources && ret=0
fi
return ret
}
but may be I can omit _values just as well, besides it seems to be buggy
at this point.
thanks
-andrej
next prev parent reply other threads:[~2002-02-25 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-22 12:14 Borsenkow Andrej
2002-02-25 8:54 ` Sven Wischnowsky
2002-02-25 9:22 ` Borsenkow Andrej [this message]
2002-02-25 9:54 ` Oliver Kiddle
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=1014628956.5254.7.camel@localhost.localdomain \
--to=andrej.borsenkow@mow.siemens.ru \
--cc=wischnow@berkom.de \
--cc=zsh-users@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).