help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] zed fails with setopt nounset unless option -x is given
Date: Fri, 20 May 2022 08:00:17 -0700	[thread overview]
Message-ID: <CAH+w=7YnBTLPNkU=BewpWERZMHpP6BenuGc2vmKG=kZfG6h7SQ@mail.gmail.com> (raw)
In-Reply-To: <641523655.251203.1653056242563@mail2.virginmedia.com>

On Fri, May 20, 2022 at 7:18 AM Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> Looks straightforward.
> +if [[ $+opts[-x] == 1 && $opts[-x] == <-> ]]; then

This actually points out a potential issue with nounset in general:
There's no way to pre-declare an associative array key (or even a
normal array element) to prevent this from happening, the way one can
use typeset to declare a scalar.

  parent reply	other threads:[~2022-05-20 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 14:06 Risto Laitinen
2022-05-20 14:17 ` Peter Stephenson
2022-05-20 14:39   ` Bart Schaefer
2022-05-20 15:00   ` Bart Schaefer [this message]
2022-05-25  9:48   ` Peter Stephenson

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7YnBTLPNkU=BewpWERZMHpP6BenuGc2vmKG=kZfG6h7SQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \


* 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


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).