From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22516 invoked by alias); 6 Jun 2015 16:46:51 -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: 35400 Received: (qmail 9341 invoked from network); 6 Jun 2015 16:46:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=D7vkDaDvg3BICLtUWdZu+HtPx/3Q+vCRRSvUbIIZzG4=; b=GzyW6K9KUbWa1YoRFcBJuhW+l2WrZu6JTSR1ifQXhmVSXnpEj7ywxjXOdsz8j5mA4B p+37XJCaJbz4ZR+xjQqV/RKZgjVA+LITcRYTp7bOANGdCdJo4/hLv3XSlCloI4VXZ3VS E35KSZ2DFIQv5xajyrRcrjtPO7tWgNQEETreNrgv4AliS1OOUt9CUch22dHnUVxylzVA 644zN7SW3aKCH+ohL2TG1RmiKfQGrWtZHP35f2BuTjDr43cO7eov+q2qPFFH6gjE3GRH qrbh+hAtGvvXnvmqztVL+zszOIkooNPp8C8bYirEgYGeNevzwvr5GWaXWXmhGETJrK8G aTtQ== X-Gm-Message-State: ALoCoQkC1FXyNkzBo8gE2m0kTUSSEy8IGy/dXXTtlK8IW+yKSweeTAPzB09gBpKfqI9l0Fsbanv8 X-Received: by 10.202.129.70 with SMTP id c67mr7346036oid.42.1433609205766; Sat, 06 Jun 2015 09:46:45 -0700 (PDT) From: Bart Schaefer Message-Id: <150606094641.ZM12642@torch.brasslantern.com> Date: Sat, 6 Jun 2015 09:46:41 -0700 In-Reply-To: <20150605064648.GE15174@isis.sigpipe.cz> Comments: In reply to Roman Neuhauser "Re: getopts doesn't update OPTIND when called from function" (Jun 5, 8:46am) References: <55673FD8.7010301@inlv.org> <20150528181740.20267791@pwslap01u.europe.root.pri> <20150605064648.GE15174@isis.sigpipe.cz> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org, Roman Neuhauser Subject: Re: getopts doesn't update OPTIND when called from function MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 5, 8:46am, Roman Neuhauser wrote: } Subject: Re: getopts doesn't update OPTIND when called from function } } i have a problem similar to Martijn's, only there's no function in sight. } this diff shows how zsh (5.0.7, emulate -R sh) differs from other shells, } and the standard IIUC: I believe this was previously discussed here: http://www.zsh.org/mla/workers//2015/msg00196.html The key text: > In zsh, if you add a SECOND call to getopts in the example function, > you will find that the second call DOES exit with a value of 1, and > that WHEN zsh getopts exits with a return value greater than zero, > THEN the value of OPTIND is set as POSIX specifies. No one responded with an opinion of whether this conforms to the literal specification or not. -- Barton E. Schaefer