X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=renumber_marc;h=410b620e858ee12b771873170f7c8839da2f15ea;hp=7fb947bd3c79323b1890ed0ea74dc3dc9cc702d0;hb=03dccb137faaa857c9599218d5fb2d8d80706099;hpb=66d3b22157fc35fc3060788583c70da3a1aa8a8a diff --git a/renumber_marc b/renumber_marc index 7fb947b..410b620 100755 --- a/renumber_marc +++ b/renumber_marc @@ -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= -o Output filename - Options --incoming Set -t, -s, -o to incoming defaults --incumbent Set -t, -s, -o to incumbent defaults