Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completing comma seprated list of option values in _atguments
- X-seq: zsh-users 4689
- From: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: Sven Wischnowsky <wischnow@xxxxxxxxx>
- Subject: Re: Completing comma seprated list of option values in _atguments
- Date: 25 Feb 2002 12:22:30 +0300
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <15481.64476.314684.446454@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <005601c1bb9a$7f047200$21c9ca95@xxxxxxxxxxxxxx> <15481.64476.314684.446454@xxxxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author