Bug 4126 - Exit bulkmarcimport if -a and -b given

Currently it is possible to spceify both --biblios and --authorities
as command line switches to bulkmarcimport.pl. This does not make sense
so we should exit early and explain that these switches are mutually
exclusive.

To test:
- Run one of these and check that there is no complaint about missing
  options:
  perl misc/migration_tools/bulkmarcimport.pl -a -b
  sudo koha-shell -c "perl misc/migration_tools/bulkmarcimport.pl -a -b"
  kohadev
- Observe that this displays the perldoc, but does not complain about
  mutually exclusive switches.
- Apply the patch
- Rerun the command(s) from earlier.
- Verify that the script is now halted and a small explanation given.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit dbada67196)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Magnus Enger 2016-11-10 14:32:44 +00:00 committed by Katrin Fischer
parent f45cd420d1
commit 83ec319658
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,8 @@ $biblios ||= !$authorities;
$insert ||= !$update;
my $writemode = ($append) ? "a" : "w";
pod2usage( -msg => "\nYou must specify either --biblios or --authorities, not both.\n", -exitval ) if $biblios && $authorities;
if ($all) {
$insert = 1;
$update = 1;