From: Shiar Date: Thu, 17 Jan 2008 06:09:20 +0000 (+0000) Subject: run options can be given to pvpgnreport X-Git-Url: http://git.shiar.net/perl/schtarr.git/commitdiff_plain/a6843225598eb51580b75a4131386b45e5617d4c run options can be given to pvpgnreport Arguments -t and -v allow easy setup of $TEST and $DBG respectively. Also reports 1.00 as --version now. --- diff --git a/pvpgnreport b/pvpgnreport index 8ca1a6f..fc0a038 100755 --- a/pvpgnreport +++ b/pvpgnreport @@ -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")