From: Mike Taylor Date: Fri, 23 Feb 2007 16:44:50 +0000 (+0000) Subject: Test of all targets now requires explicit -a option, so it can't be X-Git-Tag: CPAN-v1.02~54^2~545 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=32552630322fe65ac28b910303ec6d00d16bd2a1;p=irspy-moved-to-github.git Test of all targets now requires explicit -a option, so it can't be done by accident. New "-f " option allows selection of targets to be tested. --- diff --git a/bin/irspy.pl b/bin/irspy.pl index 22765e4..d7fda06 100755 --- a/bin/irspy.pl +++ b/bin/irspy.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $Id: irspy.pl,v 1.21 2007-02-22 11:49:13 mike Exp $ +# $Id: irspy.pl,v 1.22 2007-02-23 16:44:50 mike Exp $ # # Run like this: # YAZ_LOG=irspy,irspy_test IRSPY_SAVE_XML=1 perl -I../lib irspy.pl -t Quick localhost:8018/IR-Explain---1 z3950.loc.gov:7090/Voyager bagel.indexdata.dk/gils bagel.indexdata.dk:210/marc @@ -18,12 +18,13 @@ use Getopt::Std; use ZOOM::IRSpy::Web; my %opts; -if (!getopts('wt:', \%opts) || @ARGV < 1) { +if (!getopts('wt:af:', \%opts) || @ARGV < 1) { print STDERR "\ Usage $0: [options] [ ...] -If no targets are specified, all targets in DB are tested. -w Use ZOOM::IRSpy::Web subclass -t Run the specified [default: all tests] + -a Test all targets (slow!) + -f Test targets found by the specified query "; exit 1; } @@ -33,7 +34,15 @@ my $class = "ZOOM::IRSpy"; $class .= "::Web" if $opts{w}; my $spy = $class->new($dbname, "admin", "fruitbat"); -$spy->targets(@targets) if @targets; +if (@targets) { + $spy->targets(@targets); +} elsif ($opts{f}) { + $spy->find_targets($opts{f}); +} elsif (!$opts{a}) { + print STDERR "$0: specify -a, -f or list of targets\n"; + exit 1; +} + $spy->initialise(); my $res = $spy->check($opts{t}); if ($res == 0) {