zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: martin f krafft <madduck@debian.org>, 526924@bugs.debian.org
Cc: zsh-workers@sunsite.dk
Subject: Re: Bug#526924: zparseopts: should use lists as values in assoc array
Date: Tue, 5 May 2009 16:05:28 +0000	[thread overview]
Message-ID: <20090505160528.GB19068@scru.org> (raw)
In-Reply-To: <20090504130124.GA13947@piper.oerlikon.madduck.net>

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.


       reply	other threads:[~2009-05-05 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090504130124.GA13947@piper.oerlikon.madduck.net>
2009-05-05 16:05 ` Clint Adams [this message]
2009-05-05 16:36   ` martin f krafft
2009-05-05 17:05   ` Bart Schaefer
2009-05-05 17:28     ` martin f krafft

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=20090505160528.GB19068@scru.org \
    --to=schizo@debian.org \
    --cc=526924@bugs.debian.org \
    --cc=madduck@debian.org \
    --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).