mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Fixes --version and --help
This commit is contained in:
@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||
namespace Pest\Plugins;
|
||||
|
||||
use Pest\Contracts\Plugins\HandlesArguments;
|
||||
use Pest\Support\View;
|
||||
use function Pest\version;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -15,24 +15,17 @@ final class Version implements HandlesArguments
|
||||
{
|
||||
use Concerns\HandleArguments;
|
||||
|
||||
/**
|
||||
* Creates a new Plugin instance.
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly OutputInterface $output
|
||||
) {
|
||||
// ..
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function handleArguments(array $arguments): array
|
||||
{
|
||||
if ($this->hasArgument('--version', $arguments)) {
|
||||
$this->output->writeln(
|
||||
sprintf('Pest %s', version()),
|
||||
);
|
||||
View::render('version', [
|
||||
'version' => version(),
|
||||
]);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return $arguments;
|
||||
|
||||
Reference in New Issue
Block a user