add debuging option
authorWolfram Schneider <wosch@indexdata.dk>
Thu, 8 Apr 2010 15:14:04 +0000 (15:14 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Thu, 8 Apr 2010 15:14:04 +0000 (15:14 +0000)
bin/irspy.pl

index 4e24088..963c1b5 100755 (executable)
@@ -32,9 +32,10 @@ $SIG{__DIE__} = sub {
 };
 
 my %opts;
 };
 
 my %opts;
-if (!getopts('wt:af:n:m:M:', \%opts) || @ARGV < 1) {
+if (!getopts('dwt:af:n:m:M:', \%opts) || @ARGV < 1) {
     print STDERR "\
 Usage $0: [options] <IRSpy-database> [<target> ...]
     print STDERR "\
 Usage $0: [options] <IRSpy-database> [<target> ...]
+       -d              debug
        -w              Use ZOOM::IRSpy::Web subclass
        -t <test>       Run the specified <test> [default: all tests]
        -a              Test all targets (slow!)
        -w              Use ZOOM::IRSpy::Web subclass
        -t <test>       Run the specified <test> [default: all tests]
        -a              Test all targets (slow!)
@@ -52,7 +53,11 @@ $class .= "::Web" if $opts{w};
 
 if ($opts{M} && $opts{M} > 0) {
     no warnings;
 
 if ($opts{M} && $opts{M} > 0) {
     no warnings;
-    $class::xslt_max_depth = $opts{M}
+    $ZOOM::IRSpy::xslt_max_depth = $opts{M};
+}
+if ($opts{d}) { 
+    no warnings;
+    $ZOOM::IRSpy::debug = $opts{d};
 }
 
 my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n});
 }
 
 my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n});