Skip to content

Commit

Permalink
addbib: -p option handling (#472)
Browse files Browse the repository at this point in the history
* If file argument '0' was given to the -p option, it was incorrectly ignored
* extra1: remove warnings.pm as done in other scripts
* extra2: simplify prompt input regex by writing it as a character group; found by perlcritic
  • Loading branch information
mknos committed Feb 29, 2024
1 parent 46077ed commit 670aa97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/addbib
Expand Up @@ -13,7 +13,6 @@ License: perl


use strict;
use warnings;
use Getopt::Std;
use vars qw($opt_a $opt_p);

Expand All @@ -34,7 +33,7 @@ my @prompts = (
"Keywords:\t%K",
);

if ($opt_p) {
if (defined $opt_p) {
@prompts = ();
open my $PROMPTFILE, '<', $opt_p or die "can't read $opt_p: $!";
foreach (<$PROMPTFILE>) {
Expand Down Expand Up @@ -113,7 +112,7 @@ while (1) {
print "Continue? (y) ";
$_ = <>;
}
last if /^(n|q)/i;
last if m/\A[nq]/i;
}

close $DATABASE or die "can't close $database: $!";
Expand Down

0 comments on commit 670aa97

Please sign in to comment.