From b62d35feb90a04da16c27e9aef1ae7b23a536539 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 11 Apr 2013 15:50:49 +0300 Subject: [PATCH] Fix handling of --verbose=... and BC break --- src/Symfony/Component/Console/Application.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 4101426c91..7b437f1986 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -184,19 +184,13 @@ class Application if (true === $input->hasParameterOption(array('--quiet', '-q'))) { $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - } - - if (true === $input->hasParameterOption('-v')) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - } - - if (true === $input->hasParameterOption('--verbose')) { - switch ($input->getParameterOption('--verbose', 1)) { - case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break; - case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break; - case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break; - - default: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + } else { + if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3')) { + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2')) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose')) { + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); } }