Exit 1 on option errors.

This commit is contained in:
Daniel Nichter
2012-10-22 11:43:33 -06:00
parent e9c24579bf
commit 289366ebdf

View File

@@ -669,7 +669,7 @@ sub get_opts {
else { else {
print "Error parsing version. See the VERSION section of the tool's documentation.\n"; print "Error parsing version. See the VERSION section of the tool's documentation.\n";
} }
exit 0; exit 1;
} }
if ( @ARGV && $self->{strict} ) { if ( @ARGV && $self->{strict} ) {
@@ -988,7 +988,7 @@ sub usage_or_errors {
} }
elsif ( scalar @{$self->{errors}} ) { elsif ( scalar @{$self->{errors}} ) {
print $self->print_errors() or die "Cannot print errors: $OS_ERROR"; print $self->print_errors() or die "Cannot print errors: $OS_ERROR";
exit 0 unless $return; exit 1 unless $return;
} }
return; return;