From: Shawn Boyette Date: Wed, 27 Aug 2008 19:15:15 +0000 (+0000) Subject: command line should be able to modify presets (fingerprinter --incoming -o someothero... X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=03dccb137faaa857c9599218d5fb2d8d80706099 command line should be able to modify presets (fingerprinter --incoming -o someotheroutputfile) --- diff --git a/fingerprinter b/fingerprinter index 46759b9..3b7e0ef 100755 --- a/fingerprinter +++ b/fingerprinter @@ -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 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