From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12404 invoked from network); 23 Nov 1999 20:36:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Nov 1999 20:36:36 -0000 Received: (qmail 23137 invoked by alias); 23 Nov 1999 20:36:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8761 Received: (qmail 23129 invoked from network); 23 Nov 1999 20:36:12 -0000 Subject: Re: "getopts" bugs and bad interactions with "shift" In-Reply-To: <991123180832.ZM29676@candle.brasslantern.com> from Bart Schaefer at "Nov 23, 1999 6: 8:32 pm" To: schaefer@candle.brasslantern.com (Bart Schaefer) Date: Tue, 23 Nov 1999 20:36:06 +0000 (GMT) Cc: zsh-workers@sunsite.auc.dk X-Mailer: ELM [version 2.4ME+ PL48 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: From: Zefram Bart Schaefer wrote: >Question: Is "getopts" based on some standard or emulated behavior of >some other shell, or is it strictly a zsh thing? It's in POSIX.2. My rewrite was an attempt to directly implement the text of the standard. (I no longer have access to the standard, unfortunately.) As you can tell from the code, the standard definition is pretty unpleasant. There are places where it's not clear what state is stored in parameters and what is supposed to be hidden, and the text doesn't address the issue of multiple consecutive uses of getopts at all. I wouldn't be surprised if there are actually bugs in the standard. -zefram