zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: zsh-workers@sunsite.dk
Subject: Re: ${(kv)foo[bar]}
Date: Sun, 3 Apr 2005 22:00:34 +0400	[thread overview]
Message-ID: <200504032200.41605.arvidjaar@newmail.ru> (raw)
In-Reply-To: <1050403174903.ZM4196@candle.brasslantern.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 03 April 2005 21:49, Bart Schaefer wrote:
>
> Isn't that a rather silly way to do it in any case?  You don't need the
> subscript flags at all.  Why not
>
>       pkgs=( $(urpmq --list
>                 --media ${opt_args[--media]}
>                 --searchmedia ${opt_args[--searchmedia]}
>                 2> /dev/null
>            )
>

because it breaks if no --media is given on command line. My example would 
have worked in both cases.

> If for some reason you want to be deliberately obscure, you can force it
> with:
>
>       pkgs=( $(urpmq --list
>                 ${(kv)opt_args[(i)--media]}
>                 ${(kv)opt_args[(i)--searchmedia]}
>                 2> /dev/null
>            )
>

OK, in my case it turned out I needed something more elaborate anyway but 
thank's for the idea, I'll keep it in mind :)

Although it is rather hard to understand why ${(kv)opt_args[(i)--media]} 
should work and ${(kv)opt_args[--media]} not.

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCUC9JR6LMutpd94wRAimbAJ9bmX5OGhZAWmDgJREeHrkyFhuDNACdE7yU
c2ROqzFKiCBtUa0aoJaKs9s=
=EvN6
-----END PGP SIGNATURE-----


  reply	other threads:[~2005-04-03 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-03 10:35 ${(kv)foo[bar]} Andrey Borzenkov
2005-04-03 17:49 ` ${(kv)foo[bar]} Bart Schaefer
2005-04-03 18:00   ` Andrey Borzenkov [this message]
2005-04-03 19:58     ` ${(kv)foo[bar]} Bart Schaefer

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=200504032200.41605.arvidjaar@newmail.ru \
    --to=arvidjaar@newmail.ru \
    --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).