# Available log-levels are as follows:
# irspy -- high-level application logging
# irspy_debug -- low-level debugging (not very interesting)
# Available log-levels are as follows:
# irspy -- high-level application logging
# irspy_debug -- low-level debugging (not very interesting)
print STDERR "\
Usage $0: [options] <IRSpy-database> [<target> ...]
-w Use ZOOM::IRSpy::Web subclass
-t <test> Run the specified <test> [default: all tests]
-a Test all targets (slow!)
-f <query> Test targets found by the specified query
print STDERR "\
Usage $0: [options] <IRSpy-database> [<target> ...]
-w Use ZOOM::IRSpy::Web subclass
-t <test> Run the specified <test> [default: all tests]
-a Test all targets (slow!)
-f <query> Test targets found by the specified query
-my $spy = $class->new($dbname, "admin", "fruitbat");
+my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n});
if (@targets) {
$spy->targets(@targets);
} elsif ($opts{f}) {
$spy->find_targets($opts{f});
} elsif (!$opts{a}) {
print STDERR "$0: specify -a, -f <query> or list of targets\n";
if (@targets) {
$spy->targets(@targets);
} elsif ($opts{f}) {
$spy->find_targets($opts{f});
} elsif (!$opts{a}) {
print STDERR "$0: specify -a, -f <query> or list of targets\n";
+ exit 2;
+}
+
+if (defined $opts{m}) {
+ my($n, $i) = ($opts{m} =~ /^(\d+),(\d+)$/);
+ if (!defined $n) {
+ print STDERR "$0: argument to -m must be of the form <n>,<i>\n";
+ exit 3;
+ }
+ $spy->restrict_modulo($n, $i);