command line should be able to modify presets (fingerprinter --incoming -o someothero...
[migration-tools.git] / renumber_marc
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