Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#526924: zparseopts: should use lists as values in assoc array
- X-seq: zsh-workers 26927
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: martin f krafft <madduck@xxxxxxxxxx>, 526924@xxxxxxxxxxxxxxx
- Subject: Re: Bug#526924: zparseopts: should use lists as values in assoc array
- Date: Tue, 5 May 2009 16:05:28 +0000
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20090504130124.GA13947@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: martin f krafft <madduck@xxxxxxxxxx>, 526924@xxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090504130124.GA13947@xxxxxxxxxxxxxxxxxxxxxxxxxx>
On Mon, May 04, 2009 at 03:01:24PM +0200, martin f krafft wrote:
> piper:~|master|% set -- -a1 -a2; zparseopts -A arr a+:; echo $arr[-a]
> 12
>
> Unfortunately, this greatly reduces the usefulness of the builtin,
> since it's impossible to tell from the hash value whether the
> options where -a1 -a2 or -a12.
>
> It would be better if the value pointed to by the hash would contain
> a list, such that $arr[-a] in the above would be (1 2).
Unfortunately we don't handle arrays as values of associate arrays
(yet?) but you can do something like
set -- -a1 -a2; zparseopts 'a+:=arr'; print -l $arr
although this seems to set arr=(1 -a 2), which is not what I
expected to happen.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author