XXX: scmap: restore metadata marking (era-dependant styling)
[perl/schtarr.git] / pvpgnreport
index 8ca1a6f960a126dcdd726eec31a26247b448afbf..1f1abea19554cfa8e9f631be12d5b94b707fcfd7 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")
@@ -33,9 +41,8 @@ my ($placeid) = $name =~ /.*([a-z]{2})/;
 my $place = $placetxt{$placeid} or die "Unknown place id: $placeid\n";
 print "Resolved place '$placeid' to $place\n" if $DBG;
 
-use DBIx::Simple;
-my @dbinfo = do "dbinfo.inc.pl";
-my $Db = DBIx::Simple->connect(@dbinfo, {pg_enable_utf8 => 1})
+use Games::StarCraft::DB;
+my $Db = Games::StarCraft::DB->connect
        or die "No database: $DBI::errstr\n";
 
 $TEST and exit;