From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24757 invoked by alias); 11 Nov 2017 19:02:12 -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: 42012 Received: (qmail 19124 invoked by uid 1010); 11 Nov 2017 19:02:12 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org 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(37.59.109.123):SA:0(-1.9/5.0):. Processed in 10.183456 secs); 11 Nov 2017 19:02:12 -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,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: [PATCH] don't exit shell on [[ -o invalid@option ]] To: zsh-workers@zsh.org References: <0d6faa9a-fb69-8343-9630-a60d8f1bee0a@inlv.org> <171110143717.ZM16244@torch.brasslantern.com> <20171111124528.035a70ac@ntlworld.com> From: Martijn Dekker Message-ID: <38275e86-81c7-dbf8-544e-b0a399a4461d@inlv.org> Date: Sat, 11 Nov 2017 19:01:53 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171111124528.035a70ac@ntlworld.com> Content-Type: multipart/mixed; boundary="------------6DEBA0DF8431A33645767EA9" Content-Language: en-GB --------------6DEBA0DF8431A33645767EA9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Op 11-11-17 om 12:45 schreef Peter Stephenson: > On Fri, 10 Nov 2017 14:37:17 -0800 > Bart Schaefer wrote: >> 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. > > It's not clear if it matters in practice rather than theory, no. The > test failing is probably usually good enough. > > We could attach it to POSIXBUILTINS as that does control some aspects of > reutrn / exit behaviour, and [[ ... ]] behaves like a specially parsed > builtin. Something like this? Seems a bit wrong as this is not POSIX at all. Also, POSIXBUILTINS makes 'set -o' exit the shell on an invalid option, which is the opposite effect. But I can't find a better shell option either. - M. --------------6DEBA0DF8431A33645767EA9 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="dont-exit-on-testing-invalid-option.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dont-exit-on-testing-invalid-option.patch" ZGlmZiAtLWdpdCBhL0RvYy9ac2gvY29uZC55byBiL0RvYy9ac2gvY29uZC55bwppbmRleCBl MDhmYzBkLi4wZWE1ZmMxIDEwMDY0NAotLS0gYS9Eb2MvWnNoL2NvbmQueW8KKysrIGIvRG9j L1pzaC9jb25kLnlvCkBAIC00NSw2ICs0NSw4IEBAIGl0ZW0odHQoLW8pIHZhcihvcHRpb24p KSgKIHRydWUgaWYgb3B0aW9uIG5hbWVkIHZhcihvcHRpb24pIGlzIG9uLiAgdmFyKG9wdGlv bikKIG1heSBiZSBhIHNpbmdsZSBjaGFyYWN0ZXIsIGluIHdoaWNoIGNhc2UgaXQgaXMgYSBz aW5nbGUgbGV0dGVyIG9wdGlvbiBuYW1lLgogKFNlZSBub2RlcmVmKFNwZWNpZnlpbmcgT3B0 aW9ucykuKQorSWYgdGhlIHZhcihvcHRpb24pIGRvZXMgbm90IGV4aXN0LCB0aGUgc2hlbGwg ZXhpdHMgd2l0aCBhbiBlcnJvciBtZXNzYWdlLAordW5sZXNzIHRoZSBzaGVsbCBvcHRpb24g dHQoUE9TSVhfQlVJTFRJTlMpIGlzIHNldC4KICkKIGl0ZW0odHQoLXApIHZhcihmaWxlKSko CiB0cnVlIGlmIHZh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