| 1 | use strict; | ||
| 2 | use warnings; | ||
| 3 | |||
| 4 | our $VERSION = '0.000150'; | ||
| 5 | |||
| 6 | use Test2::Harness::UI::Config; | ||
| 7 | use Test2::Harness::UI::BackFill; | ||
| 8 | |||
| 9 | if (grep { m/^-+(h(?:elp)?|\?)$/ } @ARGV) { | ||
| 10 | print "Usage: $0 'DSN' 'METHOD' ['USER'] ['PASSWORD']\nDSN is required, sql username and password are optional.\n"; | ||
| 11 | exit 0; | ||
| 12 | } | ||
| 13 | |||
| 14 | my $dsn = shift @ARGV // die "Must provide a DSN as the first command line argument"; | ||
| 15 | |||
| 16 | my ($meth, $user, $pass) = @ARGV; | ||
| 17 | die "Must provide a method as the second command line argument\n" unless $meth; | ||
| 18 | |||
| 19 | my $config = Test2::Harness::UI::Config->new( | ||
| 20 | dbi_dsn => $dsn, | ||
| 21 | dbi_user => $user // '', | ||
| 22 | dbi_pass => $pass // '', | ||
| 23 | single_user => 1, | ||
| 24 | show_user => 0, | ||
| 25 | ); | ||
| 26 | |||
| 27 | my $backfill = Test2::Harness::UI::BackFill->new(config => $config); | ||
| 28 | $backfill->$meth(); |