Skip to content

Commit 9ab00cd

Browse files
authored
addbib: raise error for bad option (#1046)
* As with other scripts in bin/, treat getopts() failure as a fatal error (show usage and exit) * Don't suppress Getopt warnings, so the user sees feedback on which option was incorrect
1 parent a62c1fa commit 9ab00cd

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

bin/addbib

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,7 @@ sub process_options {
262262
my $class = shift;
263263

264264
local @ARGV = @_;
265-
{
266-
local $SIG{__WARN__} = sub { 1 };
267-
Getopt::Std::getopts( 'ap:');
268-
}
269-
265+
Getopt::Std::getopts( 'ap:') or $class->usage();
270266
return $ARGV[0];
271267
}
272268

0 commit comments

Comments
 (0)