2023-07-22 17:33:38 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\command\dev;
|
|
|
|
|
|
|
|
|
|
use SPC\command\BaseCommand;
|
2023-08-20 19:51:45 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
2023-07-22 17:33:38 +08:00
|
|
|
use SPC\store\Config;
|
|
|
|
|
use Symfony\Component\Console\Attribute\AsCommand;
|
|
|
|
|
|
2023-08-08 19:22:22 +08:00
|
|
|
#[AsCommand('dev:ext-all', 'Dev command', ['list-ext'])]
|
2023-07-22 17:33:38 +08:00
|
|
|
class AllExtCommand extends BaseCommand
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
public function configure(): void
|
2023-07-22 17:33:38 +08:00
|
|
|
{
|
2023-08-08 19:22:22 +08:00
|
|
|
$this->addOption('line', 'l', null, 'Show with separate lines');
|
2023-07-22 17:33:38 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
2023-07-22 17:33:38 +08:00
|
|
|
public function handle(): int
|
|
|
|
|
{
|
2023-08-08 19:22:22 +08:00
|
|
|
$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
|
|
|
}
|
|
|
|
|
}
|