From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12434 invoked from network); 25 Feb 2002 09:23:03 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Feb 2002 09:23:03 -0000 Received: (qmail 6402 invoked by alias); 25 Feb 2002 09:22:44 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4689 Received: (qmail 6391 invoked from network); 25 Feb 2002 09:22:43 -0000 From: Borsenkow Andrej To: Sven Wischnowsky Cc: zsh-users@sunsite.dk Subject: Re: Completing comma seprated list of option values in _atguments In-Reply-To: <15481.64476.314684.446454@wischnow.berkom.de> References: <005601c1bb9a$7f047200$21c9ca95@mow.siemens.ru> <15481.64476.314684.446454@wischnow.berkom.de> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution/1.0.21mdk Date: 25 Feb 2002 12:22:30 +0300 Message-Id: <1014628956.5254.7.camel@localhost.localdomain> Mime-Version: 1.0 On =F0=CE=C4, 2002-02-25 at 11:54, Sven Wischnowsky wrote: >=20 > Borsenkow Andrej wrote: >=20 > > 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 :( >=20 > Yes, _values is not intended for that, although it depends on how the > values are generated, of course... >=20 > We probably don't need utility functions for everything, simple > solution, not that nice, but ok when values may appear more than = once: >=20 I finally ended up with _urpmi_media() { local source media brace ret=3D1 opt local -a all_sources local context state line typeset -A val_args while read source media brace; do [[ "$brace" !=3D "{" ]] && continue all_sources=3D($all_sources $source) done < /etc/urpmi/urpmi.cfg if [[ "$service" =3D=3D urpmq ]]; then _values -s , "urpmi media" "$all_sources[@]" && ret=3D0 else _wanted urpmi_media expl 'available media' \ compadd "$@" -a -- all_sources && ret=3D0 fi return ret } but may be I can omit _values just as well, besides it seems to be = buggy at this point. thanks -andrej