command line should be able to modify presets (fingerprinter --incoming -o someothero...
authorShawn Boyette <sboyette@esilibrary.com>
Wed, 27 Aug 2008 19:15:15 +0000 (19:15 +0000)
committerShawn Boyette <sboyette@esilibrary.com>
Wed, 27 Aug 2008 19:15:15 +0000 (19:15 +0000)
fingerprinter
renumber_marc

index 46759b9..3b7e0ef 100755 (executable)
@@ -285,6 +285,19 @@ sub initialize {
     # set mode on existing filehandles
     binmode(STDIN, ':utf8');
 
+    # set defaults if told to do so
+    if ($c->{incoming}) {
+        $c->{tag} = 903;
+        $c->{subfield} = 'a';
+        $c->{output} = 'incoming.fp';
+        $c->{exception} = 'incoming.ex';
+    } elsif ($c->{incumbent}) {
+        $c->{tag} = 901;
+        $c->{subfield} = 'c';
+        $c->{output} = 'incumbent.fp';
+        $c->{exception} = 'incumbent.ex';
+    }
+
     my $rc = GetOptions( $c,
                          'incoming',
                          'incumbent',
@@ -299,19 +312,6 @@ sub initialize {
     show_help() unless $rc;
     show_help() if ($c->{help});
 
-    # set defaults if told to do so
-    if ($c->{incoming}) {
-        $c->{tag} = 903;
-        $c->{subfield} = 'a';
-        $c->{output} = 'incoming.fp';
-        $c->{exception} = 'incoming.ex';
-    } elsif ($c->{incumbent}) {
-        $c->{tag} = 901;
-        $c->{subfield} = 'c';
-        $c->{output} = 'incumbent.fp';
-        $c->{exception} = 'incumbent.ex';
-    }
-
     my @keys = keys %{$c};
     show_help() unless (@ARGV and @keys);
     for my $key ('runtype', 'tag', 'subfield', 'output', 'exception')
@@ -352,8 +352,8 @@ Options
   --incoming     Set -r to 'full'; -t, -s, -o, -x to incoming defaults
   --incumbent    Set -r to 'full'; -t, -s, -o, -x to incumbent defaults
 
-                 Example: '$0 --incoming' is equivalent to
-                          '$0 -r full -t 903 -s a -o incoming.fp -x incoming.ex'
+  Example: '$0 --incoming' is equivalent to
+           '$0 -r full -t 903 -s a -o incoming.fp -x incoming.ex'
 
   --quiet    -q  Don't write status messages to STDOUT
 HELP
index 7fb947b..410b620 100755 (executable)
@@ -56,6 +56,17 @@ sub initialize {
     # set mode on existing filehandles
     binmode(STDIN, ':utf8');
 
+    # set defaults if told to do so
+    if ($c->{incoming}) {
+        $c->{tag} = 903;
+        $c->{subfield} = 'a';
+        $c->{output} = 'incoming.renumbered.marc.xml';
+    } elsif ($c->{incumbent}) {
+        $c->{tag} = 901;
+        $c->{subfield} = 'c';
+        $c->{output} = 'incumbent.renumbered.marc.xml';
+    }
+
     my $rc = GetOptions( $c,
                          'incoming',
                          'incumbent',
@@ -68,17 +79,6 @@ sub initialize {
     show_help() unless $rc;
     show_help() if ($c->{help});
 
-    # set defaults if told to do so
-    if ($c->{incoming}) {
-        $c->{tag} = 903;
-        $c->{subfield} = 'a';
-        $c->{output} = 'incoming.renumbered.marc.xml';
-    } elsif ($c->{incumbent}) {
-        $c->{tag} = 901;
-        $c->{subfield} = 'c';
-        $c->{output} = 'incumbent.renumbered.marc.xml';
-    }
-
     my @keys = keys %{$c};
     show_help() unless (@ARGV and @keys);
     for my $key ('renumber-from', 'tag', 'subfield', 'output')
@@ -105,7 +105,6 @@ Req'd Arguments
   --tag=N                  -t  Which tag to use
   --subfield=X             -s  Which subfield to use
   --output=<file>          -o  Output filename
-
 Options
   --incoming     Set -t, -s, -o to incoming defaults
   --incumbent    Set -t, -s, -o to incumbent defaults