Skip to content

Commit f83da4d

Browse files
maxbeckerschalasr
authored andcommitted
[Console] Fix error output on windows cli
1 parent 4f40012 commit f83da4d

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Application.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
254254
$alternative = $alternatives[0];
255255

256256
$style = new SymfonyStyle($input, $output);
257-
$style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
257+
$style->block(sprintf('Command "%s" is not defined.', $name), null, 'error', ' ', true);
258258
if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) {
259259
if (null !== $this->dispatcher) {
260260
$event = new ConsoleErrorEvent($input, $output, $e);
@@ -955,11 +955,21 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
955955
}
956956

957957
switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) {
958-
case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break;
959-
case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break;
960-
case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break;
961-
case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break;
962-
default: $shellVerbosity = 0; break;
958+
case -1:
959+
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
960+
break;
961+
case 1:
962+
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
963+
break;
964+
case 2:
965+
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
966+
break;
967+
case 3:
968+
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
969+
break;
970+
default:
971+
$shellVerbosity = 0;
972+
break;
963973
}
964974

965975
if (true === $input->hasParameterOption(['--quiet', '-q'], true)) {

0 commit comments

Comments
 (0)