Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Apr 11, 2022
1 parent ae82049 commit a1f5056
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CliCommand.php
Expand Up @@ -60,7 +60,7 @@ protected function configure(): void
InputOption::VALUE_NONE,
"For any errors messages application will use StdOut instead of ErrOut. It's on your own risk!"
)
->addOption('strict', null, InputOption::VALUE_NONE, 'None-zero exit code on any StdErr message')
->addOption('non-zero-on-error', null, InputOption::VALUE_NONE, 'None-zero exit code on any StdErr message')
->addOption('timestamp', null, InputOption::VALUE_NONE, 'Show timestamp at the beginning of each message')
->addOption('profile', null, InputOption::VALUE_NONE, 'Display timing and memory usage information');

Expand Down Expand Up @@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$exitCode = Vars::range($exitCode, 0, 255);

if ($this->helper->isOutputHasErrors() && $this->getOptBool('strict')) {
if ($this->helper->isOutputHasErrors() && $this->getOptBool('non-zero-on-error')) {
$exitCode = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Cli/CliOutputTest.php
Expand Up @@ -199,7 +199,7 @@ public function testStdoutOnly()
public function testStrict()
{
// Redirect common message
[$exitCode, $stdOut, $errOut] = Helper::executeReal('test:output', ['strict' => null]);
[$exitCode, $stdOut, $errOut] = Helper::executeReal('test:output', ['non-zero-on-error' => null]);
isSame(implode(PHP_EOL, [
'Error: Message',
'Error (e)',
Expand Down Expand Up @@ -238,7 +238,7 @@ public function testMuteErrors()

[$exitCode] = Helper::executeReal(
'test:output',
['exception' => 'Some message', 'mute-errors' => null, 'strict' => null]
['exception' => 'Some message', 'mute-errors' => null, 'non-zero-on-error' => null]
);
isSame(0, $exitCode);
}
Expand Down

0 comments on commit a1f5056

Please sign in to comment.