From f83da4d6f011d6d0ca43ed6da0a0b9808736a469 Mon Sep 17 00:00:00 2001 From: "Maximilian.Beckers" Date: Mon, 17 Oct 2022 10:30:55 +0200 Subject: [PATCH] [Console] Fix error output on windows cli --- Application.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Application.php b/Application.php index 1021a900f..64f5ae71c 100644 --- a/Application.php +++ b/Application.php @@ -254,7 +254,7 @@ public function doRun(InputInterface $input, OutputInterface $output) $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); - $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); + $style->block(sprintf('Command "%s" is not defined.', $name), null, 'error', ' ', true); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); @@ -955,11 +955,21 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; - 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: $shellVerbosity = 0; break; + case -1: + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + break; + 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: + $shellVerbosity = 0; + break; } if (true === $input->hasParameterOption(['--quiet', '-q'], true)) {