run options can be given to pvpgnreport
authorShiar <shiar@shiar.org>
Thu, 17 Jan 2008 06:09:20 +0000 (06:09 +0000)
committerShiar <shiar@shiar.org>
Thu, 17 Jan 2008 06:11:07 +0000 (06:11 +0000)
Arguments -t and -v allow easy setup of $TEST and $DBG respectively.
Also reports 1.00 as --version now.

pvpgnreport

index 8ca1a6f960a126dcdd726eec31a26247b448afbf..fc0a038032e956dd4aed7574fe7348bebf47aa42 100755 (executable)
@@ -5,9 +5,17 @@ use warnings;
 use Data::StarCraft::PvPGN::Report;
 use Data::Dumper;
 
+our $VERSION = '1.00';
+
 our $DBG = 0;
 our $TEST = 0;
 
+use Getopt::Long qw(:config bundling auto_version auto_help);
+GetOptions(
+       "verbose|v!" => \$DBG,
+       "test|t!" => \$TEST,
+);
+
 my $path = $ARGV[0] or die "Usage: $0 FILE\n";
 my ($name) = $path =~ m{([^/]+)$};
 my $report = Data::StarCraft::PvPGN::Report->open("$path.txt")