Skip to content

Commit

Permalink
[Console] Fix error output on windows cli
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbeckers authored and chalasr committed Oct 17, 2022
1 parent 4f40012 commit f83da4d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Application.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit f83da4d

Please sign in to comment.