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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 05, 2009 at 11:49:49PM -0700, Eric Wong wrote:
> Junio C Hamano <gitster@xxxxxxxxx> wrote:
> > "Robin H. Johnson" <robbat2@xxxxxxxxxx> writes:
> > 
> > > Getopt-Long v2.38 is much stricter about sloppy getopt usage. The
> > > trailing pipe causes git-svn testcases to fail for all of the --stdin
> > > argument calls.
> > >
> > > Signed-off-by: Robin H. Johnson <robbat2@xxxxxxxxxx>
> > 
> > Eric, I'll take this directly to my tree.  Ok?
> 
> The empty "" after the "|" was intended for the set-tree command to take
> a lone "-" as a parameter to also mean "--stdin".
> 
> The following should work, too, but I don't have time to test right now:
> 
> +			{ '' => \$_stdin, 'stdin' => \$_stdin,
> +			  %cmt_opts, %fc_opts, } ],
I confirm that it does correctly set the $_stdin variable (tested
briefly).

Testcase:
=====
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
my $_stdin;
my $rc = GetOptions( 'stdin' => \$_stdin, '' => \$_stdin);
printf "rc:%s s:%s\n",$rc,$_stdin;
=====

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Infra Guy
E-Mail     : robbat2@xxxxxxxxxx
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]