zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org, Roman Neuhauser <neuhauser@sigpipe.cz>
Subject: Re: getopts doesn't update OPTIND when called from function
Date: Sat, 6 Jun 2015 09:46:41 -0700	[thread overview]
Message-ID: <150606094641.ZM12642@torch.brasslantern.com> (raw)
In-Reply-To: <20150605064648.GE15174@isis.sigpipe.cz>

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


  reply	other threads:[~2015-06-06 16:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 16:18 Martijn Dekker
2015-05-28 17:17 ` Peter Stephenson
2015-06-05  6:46   ` Roman Neuhauser
2015-06-06 16:46     ` Bart Schaefer [this message]
2015-06-07  8:30       ` Roman Neuhauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150606094641.ZM12642@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=neuhauser@sigpipe.cz \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).