diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-09-04 09:36:11 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-09-04 09:36:11 -0700 |
commit | cc48dc2399cddb35117f85149a1475126f181594 (patch) | |
tree | eee8badc6eb00c9e95c0ab87523994e6d0823d81 | |
parent | 2c2424f346c459e1afe093896fcb18390abb3fa6 (diff) | |
parent | 883f117643e91d213451f5aebde765e67d2706aa (diff) |
Merge pull request #28 from preaction/reorder-args
runtests.pl: switch the order of arguments
-rw-r--r-- | runtests.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtests.pl b/runtests.pl index 5facbe6..2e2b795 100644 --- a/runtests.pl +++ b/runtests.pl @@ -5,13 +5,13 @@ use Term::ANSIColor; use IO::Handle; use IPC::Open2; -my $usage="runtests.pl PROGRAM SPEC\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; +my $usage="runtests.pl SPEC PROGRAM\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; -my $PROG=$ARGV[0]; -my $SPEC=$ARGV[1]; +my $SPEC = shift @ARGV; +my @PROG = @ARGV; my $PATT=$ENV{'PATT'}; -if (!(defined $PROG && defined $SPEC)) { +if (!(@PROG && defined $SPEC)) { print STDERR $usage; exit 1; } @@ -69,7 +69,7 @@ sub dotest # We use → to indicate tab and ␣ space in the spec $markdown =~ s/→/\t/g;s/␣/ /g; $html =~ s/→/\t/g;s/␣/ /g; - open2(my $out, my $in, $PROG); + open2(my $out, my $in, @PROG); print $in $markdown; close $in; flush $out; |