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 {
|
||||
my ($level, $msg) = @_;
|
||||
if ($Option{'testmode'}) {
|
||||
# Convert TEST_VERBOSE=y into numeric value
|
||||
$ENV{TEST_VERBOSE} = 3
|
||||
if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/;
|
||||
$Option{'verbose'} = $ENV{TEST_VERBOSE}
|
||||
if $ENV{TEST_VERBOSE} && ! $Option{'verbose'};
|
||||
print "# $msg\n"
|
||||
if $Option{'verbose'} >= $level;
|
||||
|
||||
my $verbose = exists $Option{'verbose'} ? $Option{'verbose'} :
|
||||
length $ENV{TEST_VERBOSE} ? $ENV{TEST_VERBOSE} : 0;
|
||||
print "# $msg\n" if $verbose >= $level;
|
||||
}
|
||||
elsif ($Option{'verbose'} >= $level) {
|
||||
warn "$msg\n";
|
||||
|
|
Loading…
Reference in a new issue