From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8668 invoked from network); 30 Apr 2007 09:40:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Apr 2007 09:40:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 29956 invoked from network); 30 Apr 2007 09:40:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 09:40:11 -0000 Received: (qmail 1650 invoked by alias); 30 Apr 2007 09:40:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23362 Received: (qmail 1636 invoked from network); 30 Apr 2007 09:40:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Apr 2007 09:40:06 -0000 Received: (qmail 29440 invoked from network); 30 Apr 2007 09:40:06 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 09:40:02 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly22c.srv.mailcontrol.com (MailControl) with ESMTP id l3U9aa2N016316 for ; Mon, 30 Apr 2007 10:39:54 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 30 Apr 2007 10:39:46 +0100 Date: Mon, 30 Apr 2007 10:39:46 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: [half-patch][feedback?] exec compatibility Message-Id: <20070430103946.7f48b9e0.pws@csr.com> In-Reply-To: <20070430052931.GA75651@redoubt.spodhuis.org> References: <20070430052931.GA75651@redoubt.spodhuis.org> Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Apr 2007 09:39:46.0803 (UTC) FILETIME=[7D652430:01C78B0B] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.67.0.132 Phil Pennock wrote: > - exec [ -c ] [ -a name ] [ arg ... ] > > Bash implements this, and the -l option too. >... > I've started implementing the compatibility; I've documented all > three, implemented -l and -a. I'd like feedback before continuing: > > (1) is this worth doing at all, or should I stop? Yes, it's probably a good thing to have. If bash is treating exec in that fashion there's little gain in sticking strictly to the "precommand modifiers don't have options" rule. > (2) to implement -c, is it best to change the interface to execute()? > Are there any compability issues with modules if I do that? I > was thinking of changing the second parameter from "dash" to > "flags" and using the same BINF_ option-space, but with a > BINF_CLEARENV flag added; just clear the env _after_ checking for > ARGV0 and it looks valid to me. Should be fine... I think there's just the one call to execute(), and in the current set up it could be static. You could change it to that just to be sure. > (3) am I going about all this the wrong way? Ideally munging of options should be done by the builtin handler, with the options defined by the entry in builtins[] in builtin.c. For normal builtins that's in execbuiltin(). However, it's not currently implemented for precommand modifiers. One reason for that is probably that usually the word following is to be treated like a command even if it looks like an option. Still, it would be neater to have a general option parser of some sort in this case. However, it may be overkill just for this one use. Send me a Sourceforge user name if you want commit access. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview