From 3418cadb8e78a94ab9d2253980b8fe8ec62474f1 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Fri, 18 Nov 2011 11:14:50 +0000 Subject: [PATCH] Make 'verbose' option default to 0 in testmode. --- stow.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stow.in b/stow.in index 685774c..87da6fb 100755 --- a/stow.in +++ b/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";