From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15746 invoked by alias); 5 Nov 2012 16:14:34 -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: X-Seq: 30780 Received: (qmail 15192 invoked from network); 5 Nov 2012 16:14:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.214.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=HuP0cnC6ZoKv8xs31j5AOU28QTUl4u0N3MgzMxXqlXs=; b=m9scnCHoAmYQxCGNRCVHKKylBR8n41AFrP+ZEaWTDVORWMM8NxLnSeoPze6R17395y 0gpxVbX+1mmP0stCwIQlsaXCXLcM4OxuqI0DHomo+MYeLjgn17+zCN88/sX3a6YNYVwe gRQQY+1GRWRxezDeIk0Rl+o13ZT2WkWqXwDxxHk7kYI3+Mg5n9mF0BlXAjZ3+dptFDIR mFaEgOooxuAATPF8iXG0yMFn4WdIMc43/cBNKpTwOqnK6MemcgjqdSkVBLnYnirCRq9j veb7I/+2fytCgQ07JFxb+uxBW3q3H3AcFj5ImnrNMu3siElmicVMc1smAh7cOS8gZXBA CspA== MIME-Version: 1.0 X-Originating-IP: [80.239.194.50] In-Reply-To: <20121105145501.50c674f1@pwslap01u.europe.root.pri> References: <121102143911.ZM14168@torch.brasslantern.com> <20121105142942.41d73d31@pwslap01u.europe.root.pri> <20121105145501.50c674f1@pwslap01u.europe.root.pri> Date: Mon, 5 Nov 2012 16:08:18 +0000 Message-ID: Subject: Re: Function code breaking out of if then ...fi From: Peter Stephenson To: zsh-workers@zsh.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlvzC9OC+DIAkjWle5AR93POFoGBrv3O9rgDT0E+77dRcP4NTduDsCdtQn3b3EeEB59QM0j Another inconsistency with error handling... % fn() { setopt mumbly; print Got here; } % fn fn:setopt: no such option: mumbly Got here % fn() { set -o mumbly; print Got here; } % fn fn:set: no such option: mumbly This is because set is a POSIX special builtin but setopt isn't. It should be documented, however. Index: Doc/Zsh/builtins.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v retrieving revision 1.145 diff -p -u -r1.145 builtins.yo --- Doc/Zsh/builtins.yo 11 Oct 2012 20:14:03 -0000 1.145 +++ Doc/Zsh/builtins.yo 5 Nov 2012 16:06:10 -0000 @@ -1361,6 +1361,11 @@ or without the tt(no) prefix remains the If the tt(-m) flag is given the arguments are taken as patterns (which should be quoted to protect them from filename expansion), and all options with names matching these patterns are set. + +Note that a bad option name does not cause execution of shell code +to be aborted; this is different from `tt(set -o)'. This is because +tt(set) is regarded as a special builtin by the POSIX standard, +but tt(setopt) is not. ) findex(shift) cindex(parameters, positional) pws