git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix sloppy Getopt::Long.

From
Robin H. Johnson <robbat2@gentoo.org>
Date
May 8, 2009, 18:28 UTC
Message-ID
<robbat2.20090508T182516.673117391Z@orbis-terrarum.net>
In-Reply-To
<7v63gew3dp.fsf@alter.siamese.dyndns.org>
On Wed, May 06, 2009 at 10:24:50AM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> >> +			{ '' => \$_stdin, 'stdin' => \$_stdin,
> >> +			  %cmt_opts, %fc_opts, } ],
> > I confirm that it does correctly set the $_stdin variable (tested
> > briefly).
> Wait a minute.  Do you mean we would also need the above "explicit empty
> argument sets $_stdin"?  Wasn't it your earlier analysis/claim that the
> caller already takes care of a lone "-"?

I'd originally considered a single '-' as an argument not an option, meaning stdin, not being processed within the getopt framework, but instead being handled later.

> Or do you mean "yes it would also work but it is not necessary"?

Using Eric's change makes it explicit what is expected: Passing '--stdin' is the same as passing '-'.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Previous: Junio C Hamano
Message 6 of 6 in “Fix sloppy Getopt::Long.”
  1. Fix sloppy Getopt::Long.Robin H. Johnson, May 5, 2009
  2. Junio C HamanoMay 5, 2009
  3. Robin H. JohnsonMay 5, 2009
  4. Robin H. JohnsonMay 6, 2009
  5. Junio C HamanoMay 6, 2009
  6. Robin H. JohnsonMay 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.