diff --git a/src/Console/Command.php b/src/Console/Command.php index d74813726..0a2f9cf2a 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -11,6 +11,8 @@ use Pest\Contracts\Plugins\AddsOutput; use Pest\Contracts\Plugins\HandlesArguments; use Pest\Plugin\Loader; +use Pest\Plugins\Version; +use Pest\Support\Container; use Pest\TestSuite; use PHPUnit\Framework\TestSuite as BaseTestSuite; use PHPUnit\TextUI\Command as BaseCommand; @@ -139,4 +141,12 @@ public function run(array $argv, bool $exit = true): int exit($result); } + + protected function showHelp(): void + { + /** @var Version $version */ + $version = Container::getInstance()->get(Version::class); + $version->handleArguments(['--version']); + parent::showHelp(); + } }