Bug 22509: Fix POD error
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 10 May 2019 12:55:49 +0000 (07:55 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Jun 2019 14:06:34 +0000 (15:06 +0100)
1. "Apparent command =item not preceded by blank line"
2. Display the options for help
3. Do not run if no --field passed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

misc/add_date_fields_to_marc_records.pl

index 6368c36..9d348d3 100755 (executable)
@@ -41,7 +41,8 @@ GetOptions(
     'unless-exists=s' => \$unless_exists_field,
 ) || podusage(1);
 
-pod2usage(0) if $help;
+pod2usage(1) if $help;
+pod2usage("Parameter field is mandatory") unless @fields;
 
 my @fields_to_add;
 my $dt = dt_from_string;    # Could be an option of the script
@@ -99,6 +100,8 @@ Add some MARC fields to bibliographic records.
 
 The replacement tokens are the ones used by strftime.
 
+=head1 OPTIONS
+
 =over 8
 
 =item B<--help>
@@ -112,6 +115,7 @@ Verbose mode.
 =item B<--confirm>
 
 Confirmation flag, the script will be running in dry-run mode if set not.
+
 =item B<--where>
 
 Limits the search on bibliographic records with a user-specified WHERE clause.