static-php-cli/src/SPC/command/dev/AllExtCommand.php

29 lines
678 B
PHP
Raw Normal View History

2023-07-22 17:33:38 +08:00
<?php
declare(strict_types=1);
namespace SPC\command\dev;
use SPC\command\BaseCommand;
use SPC\exception\FileSystemException;
2023-07-22 17:33:38 +08:00
use SPC\store\Config;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand('dev:ext-all', 'Dev command', ['list-ext'])]
2023-07-22 17:33:38 +08:00
class AllExtCommand extends BaseCommand
{
public function configure(): void
2023-07-22 17:33:38 +08:00
{
$this->addOption('line', 'l', null, 'Show with separate lines');
2023-07-22 17:33:38 +08:00
}
/**
* @throws FileSystemException
*/
2023-07-22 17:33:38 +08:00
public function handle(): int
{
$this->output->writeln(implode($this->input->getOption('line') ? PHP_EOL : ',', array_keys(Config::getExts())));
2023-08-06 10:43:20 +08:00
return static::SUCCESS;
2023-07-22 17:33:38 +08:00
}
}