From 352489eadd00c2b652f9253c7f0ea99ce5b04560 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 13 May 2019 13:51:06 -0400 Subject: [PATCH] added funcitonality for --marcfile as documentation suggested it had --- marc_cleanup | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) 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 < -- 1.7.2.5