zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] don't exit shell on [[ -o invalid@option ]]
Date: Fri, 10 Nov 2017 14:37:17 -0800	[thread overview]
Message-ID: <171110143717.ZM16244@torch.brasslantern.com> (raw)
In-Reply-To: <0d6faa9a-fb69-8343-9630-a60d8f1bee0a@inlv.org>

On Nov 10,  6:24pm, Martijn Dekker wrote:
}
} Does it make sense for [[ -o invalid@option ]] to exit the shell with an
} error message?

I have the impression that this was discussed on the list before, some
time ago, and the conclusion was that it was useful to be able to tell
[[ -o an_option_typo ]] apart from [[ -o an_unset_option ]].

In other words, if the option doesn't exist at all, then for any code
depending on the result of the test, both the true and false branches
may very well be wrong.

It's easy enough to write backwards-compatible code by simply adding a
subshell around the test, if that's what's intended.

We could certainly suppress the error in emulation modes given that's
what other shells do.  Further, I'm not strongly invested in the current
behavior even for native mode, but we should consider the ramifications.


  parent reply	other threads:[~2017-11-10 22:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 18:24 Martijn Dekker
2017-11-10 18:53 ` Eric Cook
2017-11-10 19:03   ` Martijn Dekker
2017-11-10 22:37 ` Bart Schaefer [this message]
2017-11-11 12:45   ` Peter Stephenson
2017-11-11 19:01     ` Martijn Dekker
2017-11-11 23:19       ` Bart Schaefer
2017-11-12 19:56         ` Peter Stephenson
2017-11-14 12:26           ` Daniel Shahaf
2017-11-14 13:22             ` Martijn Dekker
2017-11-14 23:52               ` Daniel Shahaf
2017-11-16  0:52                 ` Martijn Dekker
2017-11-18 18:22                   ` Daniel Shahaf
2017-11-19 14:46                     ` Martijn Dekker
2017-11-19 19:41                     ` Bart Schaefer
2017-11-19 19:53                       ` Peter Stephenson
2017-11-20  1:22                         ` Daniel Shahaf
2017-11-24 21:50                           ` Daniel Shahaf
2017-12-03  7:28                             ` Mikael Magnusson

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=171110143717.ZM16244@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).