From: Rogan Hamby Date: Mon, 13 May 2019 17:51:06 +0000 (-0400) Subject: added funcitonality for --marcfile as documentation suggested it had X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=352489eadd00c2b652f9253c7f0ea99ce5b04560 added funcitonality for --marcfile as documentation suggested it had --- diff --git a/marc_cleanup b/marc_cleanup index 58a68c1..524109e 100755 --- a/marc_cleanup +++ b/marc_cleanup @@ -660,6 +660,13 @@ sub initialize { $c->{'renumber-tag'} = 903 unless defined $c->{'renumber-tag'}; $c->{'renumber-subfield'} = 'a' unless defined $c->{'renumber-subfield'}; $c->{window} = 9; + if ($c->{marcfile} and $c->{prefix}) { abort('You can not declare a marc file and prefix.'); } + if ($c->{marcfile}) { + $c->{output} = join('.',$c->{marcfile},'clean') + unless $c->{output}; + $c->{exception} = join('.',$c->{marcfile},'exception') + unless $c->{exception}; + } if ($c->{prefix}) { $c->{output} = join('.',$c->{prefix},'clean','marc','xml') unless $c->{output}; @@ -685,6 +692,12 @@ sub initialize { if ( $c->{'original-tag'} and $c->{trash}->has($c->{'original-tag'}) ); } +sub abort { + my $msg = shift; + print STDERR "$0: $msg", "\n"; + exit 1; +} + sub show_help { print <