use lib '../lib';
[irspy-moved-to-github.git] / bin / irspy-rewrite-records.pl
old mode 100644 (file)
new mode 100755 (executable)
index f994de6..a560db9
@@ -1,14 +1,22 @@
 #!/usr/bin/perl
-
+#
 # perl -I ../lib irspy-rewrite-records.pl localhost:8018/IR-Explain---1
 
-use strict;
-use warnings;
+use lib '../lib';
 use ZOOM::IRSpy;
 use ZOOM::IRSpy::Utils qw(render_record);
 
+use strict;
+use warnings;
+
 my($dbname) = @ARGV;
 die "$0 no database name specified" if !defined $dbname;
+
+my $irspy_to_zeerex_xsl = $ARGV[1] || '../xsl/irspy2zeerex.xsl';
+
+$ZOOM::IRSpy::irspy_to_zeerex_xsl = $irspy_to_zeerex_xsl
+  if $irspy_to_zeerex_xsl;
+
 my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
 my $rs = $spy->{conn}->search(new ZOOM::Query::CQL("cql.allRecords=1"));
 print STDERR "rewriting ", $rs->size(), " target records";