From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29448 invoked by alias); 3 Dec 2017 07:28:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42070 Received: (qmail 27338 invoked by uid 1010); 3 Dec 2017 07:28:11 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.196):SA:0(-1.9/5.0):. Processed in 2.797977 secs); 03 Dec 2017 07:28:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nlHbWDufVmskG/UveKw925cd2ieQWUyPlkB1CKVr96M=; b=LoPQGwOfkrAFbCxkTJjw5OGN5CuNxvMJPqcVBORFbU7/gjITJrG/utYyi+rP35Y00+ eFEAo0mKZhr6Lk1Kl8imAcZe/7QacRB32a+aj03XRgXcK/lnR+MJGKVemmW9k7v1tcJi 3JQ6Wk6X71kIhEFVVG71LE1ffrqp7K7/9aCM8Pn0q1koc+wGy3Pj36f3MAI/oURmLIay bEwJk6dYu+RWbSb0XXvWXmGJKikLUUXDsycw+nAKQ5DCHdcsUNq72SYViXO/x8YNPHv5 RO0AZ6krBgf8q3bC4xUaJ91nh4JCuQ60SXpzIUZoEX0V/SrPQLhAw5ahZticBF43OPvg MNBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nlHbWDufVmskG/UveKw925cd2ieQWUyPlkB1CKVr96M=; b=r3IQGnBbfMGVe4RDPJSWXLKIeqUOaMylYVBcogsv/WsJsARg5tidG+cOT+lftRi9oE nuHyH9DYHyVRd+bRE/czpnYrvZqMaEw+V/wWcglXUINxgWaqo2OGBOguIXxFlJaK6P/6 IXAYtb7CINARkDJwI668rxOM65OBJXnniYmHuNS5GSW5GPhIUkD6JXVu2+jw6GjzIF8a 33UKIfIiMN6tL04S8Ql78EaCZ9gR03pix034yQEXVyc6eCj77XCsHmxVTW+7CIFL+E0D rVTZ9ikv5tSVVjORwY4GZr9/83t81NXbZRA2Y5qo/Jor7nrH2d8kaxQCHsQz87wkCu9e aiYg== X-Gm-Message-State: AKGB3mKb6N+v8tyP2gwT0yLvzvSvnJqY7f/7a0EiUfUOCWRenS6StV9F F5rPBIimV0uPgT8baKEkL3lj0i2s00ZjrUMAZW4= X-Google-Smtp-Source: AGs4zMYTRzpw7t5QYqOGZQgM67aIvMbLwTlUB6/9i5Bga5nzlvLOyH5YTcx0sW1xOw3RCCNJUzKTlKuu0uZj8hrXQu8= X-Received: by 10.55.18.134 with SMTP id 6mr15547595qks.136.1512286085008; Sat, 02 Dec 2017 23:28:05 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20171124215022.wegl6xcc22jqdubl@tarpaulin.shahaf.local2> References: <171111151905.ZM20139@torch.brasslantern.com> <20171112195657.74fb0b8a@ntlworld.com> <20171114122619.kqa4i2sth66mafrs@tarpaulin.shahaf.local2> <20171114235249.egcynklamldfcogv@tarpaulin.shahaf.local2> <1511029379.709069.1176966800.1BF7416A@webmail.messagingengine.com> <20171119195337.0a09b303@ntlworld.com> <1511140961.722411.1177910864.7ECFDEB6@webmail.messagingengine.com> <20171124215022.wegl6xcc22jqdubl@tarpaulin.shahaf.local2> From: Mikael Magnusson Date: Sun, 3 Dec 2017 08:28:04 +0100 Message-ID: Subject: Re: [PATCH] don't exit shell on [[ -o invalid@option ]] To: Daniel Shahaf Cc: zsh workers Content-Type: text/plain; charset="UTF-8" On Fri, Nov 24, 2017 at 10:50 PM, Daniel Shahaf 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