changed options to -o offset and -l limit
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 26 Aug 2006 23:09:20 +0000 (23:09 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 26 Aug 2006 23:09:20 +0000 (23:09 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@68 4670fa4d-42ec-0310-ab5b-a66af6943492

scripts/dump_isisdb.pl

index c2f5227..fe7c98c 100755 (executable)
@@ -17,9 +17,9 @@ BEGIN {
 }
 
 my %opt;
-getopts('dn:', \%opt);
+getopts('do:l:', \%opt);
 
-my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-d] /path/to/isis/BIBL\n";
+my $isisdb = shift @ARGV || die "usage: $0 [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n";
 
 my $isis = Biblio::Isis->new (
        isisdb => $isisdb,
@@ -30,9 +30,9 @@ my $isis = Biblio::Isis->new (
 
 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'});