diff --git a/src/Common/Command/Run.php b/src/Common/Command/Run.php index 49c689f..2c07b44 100644 --- a/src/Common/Command/Run.php +++ b/src/Common/Command/Run.php @@ -7,6 +7,7 @@ use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Testo\Render\StdoutRenderer; use Testo\Render\TeamcityInterceptor; @@ -17,12 +18,21 @@ )] final class Run extends Base { + public function configure(): void + { + parent::configure(); + $this->addOption('teamcity', null, InputOption::VALUE_NONE); + } + public function __invoke( - InputInterface $input, + InputInterface $input, OutputInterface $output, ): int { - // $this->container->bind(StdoutRenderer::class, TeamcityInterceptor::class); - $this->container->bind(StdoutRenderer::class, TerminalInterceptor::class); + if ($input->getOption('teamcity')) { + $this->container->bind(StdoutRenderer::class, TeamcityInterceptor::class); + } else { + $this->container->bind(StdoutRenderer::class, TerminalInterceptor::class); + } $result = $this->application->run();