From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5207 invoked from network); 6 Aug 2008 14:59:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Aug 2008 14:59:51 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 62334 invoked from network); 6 Aug 2008 14:59:41 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Aug 2008 14:59:41 -0000 Received: (qmail 16092 invoked by alias); 6 Aug 2008 14:59:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25404 Received: (qmail 16072 invoked from network); 6 Aug 2008 14:59:26 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 Aug 2008 14:59:26 -0000 Received: from mail.o2.co.uk (jabba.london.02.net [82.132.130.169]) by bifrost.dotsrc.org (Postfix) with ESMTP id 47ED18056E06 for ; Wed, 6 Aug 2008 16:59:20 +0200 (CEST) Received: from sc.homeunix.net (78.105.216.138) by mail.o2.co.uk (8.0.013.3) (authenticated as stephane.chazelas) id 4898862E002FDEF6; Wed, 6 Aug 2008 17:16:44 +0100 Received: from chazelas by sc.homeunix.net with local (Exim 4.69) (envelope-from ) id 1KQkTt-0004zG-7s; Wed, 06 Aug 2008 15:59:17 +0100 Date: Wed, 6 Aug 2008 15:59:17 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: PATCH: skip command from debug trap Message-ID: <20080806145917.GE5197@sc.homeunix.net> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <27237.1217946438@csr.com> <6cd6de210808051647k17f14902nce840ca3edd6ddb@mail.gmail.com> <20080806104716.44647a75@news01> <080806072236.ZM14655@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <080806072236.ZM14655@torch.brasslantern.com> User-Agent: Mutt/1.5.16 (2007-09-19) X-Virus-Scanned: ClamAV 0.92.1/7959/Wed Aug 6 15:06:37 2008 on bifrost X-Virus-Status: Clean On Wed, Aug 06, 2008 at 07:22:36AM -0700, Bart Schaefer wrote: [...] > x=3 > return --x > > returns "2". How are you going to make any kind of option parsing for > return behave compatibly with that? See for instance kill(1). To kill a process group, you have to do: kill -- - So you'd have to do return -- -3 > } (In fact, the lack of option parsing, even --, in return is strictly a > } bug, so this even makes it more compatible with other shells.) > > It'd have to be only in emulation mode, then. -- is not a valid math expression, so changing return -- so that it is the same as "return" instead of giving an error message shouldn't be a problem. Changing return -1 so that it outputs an error message instead of returning with $? == -1 could break existing scripts. BTW, is this: $ zsh -c '(){echo test;return 1}; echo $?' test 0 the expected output? -- Stéphane