remove list-ext command, use all-ext and alias to support its function

This commit is contained in:
crazywhalecc
2023-08-08 19:22:22 +08:00
committed by Jerry Ma
parent 1ed104d2f6
commit 7298e2441b
4 changed files with 28 additions and 38 deletions

View File

@@ -8,16 +8,17 @@ use SPC\command\BaseCommand;
use SPC\store\Config;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand('dev:ext-all', 'Dev command')]
#[AsCommand('dev:ext-all', 'Dev command', ['list-ext'])]
class AllExtCommand extends BaseCommand
{
public function configure()
{
$this->addOption('line', 'l', null, 'Show with separate lines');
}
public function handle(): int
{
$this->output->writeln(implode(',', array_keys(Config::getExts())));
$this->output->writeln(implode($this->input->getOption('line') ? PHP_EOL : ',', array_keys(Config::getExts())));
return static::SUCCESS;
}
}