Make 'verbose' option default to 0 in testmode.
This commit is contained in:
parent
80826b96e2
commit
3418cadb8e
1 changed files with 5 additions and 4 deletions
9
stow.in
9
stow.in
|
@ -264,12 +264,13 @@ sub process_options {
|
||||||
sub debug {
|
sub debug {
|
||||||
my ($level, $msg) = @_;
|
my ($level, $msg) = @_;
|
||||||
if ($Option{'testmode'}) {
|
if ($Option{'testmode'}) {
|
||||||
|
# Convert TEST_VERBOSE=y into numeric value
|
||||||
$ENV{TEST_VERBOSE} = 3
|
$ENV{TEST_VERBOSE} = 3
|
||||||
if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/;
|
if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/;
|
||||||
$Option{'verbose'} = $ENV{TEST_VERBOSE}
|
|
||||||
if $ENV{TEST_VERBOSE} && ! $Option{'verbose'};
|
my $verbose = exists $Option{'verbose'} ? $Option{'verbose'} :
|
||||||
print "# $msg\n"
|
length $ENV{TEST_VERBOSE} ? $ENV{TEST_VERBOSE} : 0;
|
||||||
if $Option{'verbose'} >= $level;
|
print "# $msg\n" if $verbose >= $level;
|
||||||
}
|
}
|
||||||
elsif ($Option{'verbose'} >= $level) {
|
elsif ($Option{'verbose'} >= $level) {
|
||||||
warn "$msg\n";
|
warn "$msg\n";
|
||||||
|
|
Loading…
Reference in a new issue