diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-02-01 21:44:51 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-02-01 21:44:51 +0100 |
commit | 0ed3b851c1a44ee2a46a5cf0f07fb662405485b7 (patch) | |
tree | d7287c29bbaf77e97f34385344ef5b03975e542c /Porting/bisect.pl | |
parent | 66b521dd22445ceaf2e0125c50b7cfb16f88a660 (diff) | |
download | perl-0ed3b851c1a44ee2a46a5cf0f07fb662405485b7.tar.gz |
bisect.pl now exits with 0 for success for --help
bisect.pl --help now exits with 0 for success. The "that took" timing
message is no longer shown after the help text. The sanity test for "are we
running from the current checkout" is now moved after the argument checking,
so that bisect.pl --help will always show the help text.
Diffstat (limited to 'Porting/bisect.pl')
-rwxr-xr-x | Porting/bisect.pl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Porting/bisect.pl b/Porting/bisect.pl index ee7214f62e..1a51405491 100755 --- a/Porting/bisect.pl +++ b/Porting/bisect.pl @@ -7,16 +7,14 @@ Documentation for this is in bisect-runner.pl =cut -my $start_time = time; - # The default, auto_abbrev will treat -e as an abbreviation of --end # Which isn't what we want. use Getopt::Long qw(:config pass_through no_auto_abbrev); -my ($start, $end, $validate); -unshift @ARGV, '--help' unless GetOptions('start=s' => \$start, - 'end=s' => \$end, - validate => \$validate); +my ($start, $end, $validate, $usage, $bad); +$bad = !GetOptions('start=s' => \$start, 'end=s' => \$end, + validate => \$validate, 'usage|help|?' => \$usage); +unshift @ARGV, '--help' if $bad || $usage; unshift @ARGV, '--validate' if $validate; my $runner = $0; @@ -24,6 +22,10 @@ $runner =~ s/bisect\.pl/bisect-runner.pl/; die "Can't find bisect runner $runner" unless -f $runner; +system $^X, $runner, '--check-args', '--check-shebang', @ARGV and exit 255; +exit 255 if $bad; +exit 0 if $usage; + { my ($dev0, $ino0) = stat $0; die "Can't stat $0: $!" unless defined $ino0; @@ -32,7 +34,7 @@ die "Can't find bisect runner $runner" unless -f $runner; if defined $dev1 && $dev0 == $dev1 && $ino0 == $ino1; } -system $^X, $runner, '--check-args', '--check-shebang', @ARGV and exit 255; +my $start_time = time; # We try these in this order for the start revision if none is specified. my @stable = qw(perl-5.005 perl-5.6.0 perl-5.8.0 v5.10.0 v5.12.0 v5.14.0); |