push version to 0.24
[Biblio-Isis] / scripts / dump_isisdb.pl
index c2f5227..c6f47ba 100755 (executable)
@@ -3,7 +3,7 @@
 use strict;
 use blib;
 
-use Biblio::Isis;
+use Biblio::Isis 0.24;
 use Getopt::Std;
 
 BEGIN {
@@ -17,22 +17,23 @@ BEGIN {
 }
 
 my %opt;
-getopts('dn:', \%opt);
+getopts('do:l:v', \%opt);
 
-my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-d] /path/to/isis/BIBL\n";
+my $isisdb = shift @ARGV || die "usage: $0 [-v] [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n";
 
 my $isis = Biblio::Isis->new (
        isisdb => $isisdb,
        debug => $opt{'d'} ? 2 : 0,
-       include_deleted => 1,
+       include_deleted => $opt{'v'},
 #      read_fdt => 1,
+       ignore_empty_subfields => $opt{'v'} ? 0 : 1,
 );
 
 print "rows: ",$isis->count,"\n\n";
 
-my $min = 1;
+my $min = $opt{o} || 1;
 my $max = $isis->count;
-$max = $opt{n} if ($opt{n});
+$max = ( $min + $opt{l} - 1 ) if ($opt{l});
 
 for my $mfn ($min .. $max) {
        print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});