Junio C Hamano <gitster@xxxxxxxxx> writes: > Tim Henigan <tim.henigan@xxxxxxxxx> writes: > >> +# the '--prompt' and '--no-prompt' options require special treatment >> +# because they may be specified more than once...the last one "wins". >> +for (@ARGV) { >> + if (($_ eq "-y") or ($_ eq "--no-prompt")) { >> + $prompt = 0; >> + } elsif ($_ eq "--prompt") { >> + $prompt = 1; >> + } else { >> + push(@diffargs, $_); >> + } >> +} > > I really do not like the direction in which this series is going. We do > not have a similar --no-gui option to defeat --gui option that may appear > earlier on the command line, but when we fix that bug (isn't it a bug?), > we would have to teach this loop about that option, wouldn't we? > > In the end, won't you end up resurrecting the argument parsing loop that > you got rid of with the first patch in your series? Isn't this working > around the problem introduced only because you are using Getopt::Long and > hitting its limitations? Limitations? You can basically steal code from git-send-email. As an example: ---- 8< ---- #!/usr/bin/perl use strict; use warnings; use Getopt::Long; my $foo = 0; my $rc = GetOptions("foo!" => \$foo, "n" => sub { $foo = 0; }, "y" => \$foo); print "$foo\n"; ---- 8< ---- $ ./getopt-test.perl -n 0 $ ./getopt-test.perl -y 1 $ ./getopt-test.perl --foo 1 $ ./getopt-test.perl --no-foo 0 $ ./getopt-test.perl --foo --no-foo 0 $ ./getopt-test.perl -y -n 0 $ ./getopt-test.perl --foo -n 0 -- Thomas Rast trast@{inf,student}.ethz.ch -- 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