added -d path and -n flags
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 9 Dec 2005 14:50:52 +0000 (14:50 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 9 Dec 2005 14:50:52 +0000 (14:50 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@42 4670fa4d-42ec-0310-ab5b-a66af6943492

scripts/dump_isisdb.pl

index 057cd29..19e46c2 100755 (executable)
@@ -1,25 +1,31 @@
 #!/usr/bin/perl -w
 
 use strict;
-use blib;
+#use blib;
 
 use Biblio::Isis;
+use Getopt::Std;
 use Data::Dumper;
 
-my $isisdb = shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI',
-my $debug = shift @ARGV;
+my %opt;
+getopts('dn:', \%opt);
+
+my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-d] /path/to/isis/BIBL\n";
 
 my $isis = Biblio::Isis->new (
        isisdb => $isisdb,
-       debug => $debug,
+       debug => $opt{'d'},
        include_deleted => 1,
 #      read_fdt => 1,
 );
 
 print "rows: ",$isis->count,"\n\n";
 
-for(my $mfn = 1; $mfn <= $isis->count; $mfn++) {
-       print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($debug);
+my $min = 1;
+my $max = $isis->count;
+
+for my $mfn ($min .. $max) {
+       print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});
        print $isis->to_ascii($mfn),"\n";
 
 }