Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public function mustMatchGitDiff(): bool

private function canShowProgressBar(InputInterface $input): bool
{
return $input->getOption(Option::OPTION_OUTPUT_FORMAT) !== JsonOutputFormatter::NAME;
$noProgressBar = (bool) $input->getOption(Option::OPTION_NO_PROGRESS_BAR);

return ! $noProgressBar && $input->getOption(Option::OPTION_OUTPUT_FORMAT) !== JsonOutputFormatter::NAME;
}

private function setRule(?string $rule): void
Expand Down
5 changes: 5 additions & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ final class Option
*/
public const OPTION_OUTPUT_FORMAT = 'output-format';

/**
* @var string
*/
public const OPTION_NO_PROGRESS_BAR = 'no-progress-bar';

/**
* @var string
*/
Expand Down
7 changes: 7 additions & 0 deletions src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ protected function configure(): void
sprintf('Select output format: "%s".', implode('", "', $availableOutputFormatters)),
ConsoleOutputFormatter::NAME
);

$this->addOption(
Option::OPTION_NO_PROGRESS_BAR,
null,
InputOption::VALUE_NONE,
'Hide progress bar. Useful e.g. for nicer CI output.'
);
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down