Skip to content

Commit

Permalink
bin/bmark_pq: stop on invalid options
Browse files Browse the repository at this point in the history
  • Loading branch information
arc committed Jan 7, 2012
1 parent a607150 commit ff21364
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/bmark_pq 100644 → 100755
Expand Up @@ -14,10 +14,11 @@ GetOptions ("m=s" => \@modules,
"b=s" => \@benchmarks,
"n=i" => \$n,
"t=i" => \$timeout,
"h" => \$help);
"h" => \$help)
or usage(2);

if ($help) {
usage();
usage(0);
}

if (defined $timeout) {
Expand All @@ -35,6 +36,7 @@ if (@benchmarks == 0) {
}

sub usage {
my ($status) = @_;
say <<END;
Usage:
$0 -n [exp] -t [timeout] -m [module 1] -m [module 2] -b [benchmark 1] ...
Expand All @@ -58,7 +60,7 @@ END
say "";
print_modules();
say "";
exit 0;
exit $status;
}

sub print_benchmarks {
Expand Down

0 comments on commit ff21364

Please sign in to comment.