Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 10/9 v4] difftool: fix regression in '--prompt' options

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:21

Tim Henigan [off-list ref] 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help