From: Mikael Magnusson <mikachu@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: [PATCH] don't exit shell on [[ -o invalid@option ]]
Date: Sun, 3 Dec 2017 08:28:04 +0100 [thread overview]
Message-ID: <CAHYJk3RZ7iWyhOfr7FDHqX-U3ZOoGAixDByeEb547G8iV=M_HQ@mail.gmail.com> (raw)
In-Reply-To: <20171124215022.wegl6xcc22jqdubl@tarpaulin.shahaf.local2>
On Fri, Nov 24, 2017 at 10:50 PM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Daniel Shahaf wrote on Mon, Nov 20, 2017 at 01:22:41 +0000:
>> I'm quite swamped this week (in a good way) but when I get a chance I'll
>> finish the patch and push. (Needs more tests and a README blurb, at least)
>
> Interdiff:
>
> diff --git a/README b/README
> index 6fad1d516..59abf29b2 100644
> --- a/README
> +++ b/README
> @@ -54,6 +54,18 @@ foo=([aeiou]\=vowel)
> This is only required for array values contained within parentheses;
> command line expansion for normal arguments has not changed.
>
> +3) The syntax
> +
> +[[ -o foo ]]
> +
> +where foo is not the name of a shell option (with optional underscores
> +and optional "no" prefix) used to be treated as a syntax error, i.e.,
> +the enclosing command line or file were aborted. It now emits a warning
> +and returns a non-zero exit code. For further details, see the
> +documentation of the -o switch in the chapter "Conditional Expressions"
> +in the zshmisc(1) manual.
I don't know if it's also worth pointing out that you can do
{ [[ -o invalid_option ]] } always { TRY_BLOCK_ERROR=0 }
since 4.2.1 or so? (It will suppress the syntax error but preserve the
return code).
--
Mikael Magnusson
prev parent reply other threads:[~2017-12-03 7:28 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
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 [this message]
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='CAHYJk3RZ7iWyhOfr7FDHqX-U3ZOoGAixDByeEb547G8iV=M_HQ@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=d.s@daniel.shahaf.name \
--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).