added --[no-]marc-generate
[webpac2] / run.pl
diff --git a/run.pl b/run.pl
index d6265c2..72ccca1 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -68,6 +68,11 @@ and subfield usage for each input
 
 turn on extra validation of imput records, see L<WebPAC::Validation>
 
+=item --marc-generate
+
+Generate MARC file. This will automatically be on if file contains C<marc*> directives.
+You can use this option as C<--no-marc-generate> to disable MARC generation.
+
 =item --marc-lint
 
 By default turned on if normalisation file has C<marc*> directives. You can disable lint
@@ -103,6 +108,7 @@ my $debug = 0;
 my $only_filter;
 my $stats = 0;
 my $validate_path;
+my $marc_generate = 1;
 my $marc_lint = 1;
 my $marc_dump = 0;
 my $parallel = 0;
@@ -122,6 +128,7 @@ GetOptions(
        "debug+" => \$debug,
        "stats" => \$stats,
        "validate=s" => \$validate_path,
+       "marc-generate!" => \$marc_generate,
        "marc-lint!" => \$marc_lint,
        "marc-dump!" => \$marc_dump,
        "parallel=i" => \$parallel,
@@ -431,7 +438,7 @@ while (my ($database, $db_config) = each %{ $config->databases }) {
                }
 
                my $marc;
-               if ($parser->have_rules( 'marc', $database, $input_name )) {
+               if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) {
                        $marc = new WebPAC::Output::MARC(
                                path => "out/marc/${database}-${input_name}.marc",
                                lint => $marc_lint,