diff --git a/src/SPC/command/dev/AllExtCommand.php b/src/SPC/command/dev/AllExtCommand.php index b47bdf8ed..52eb38dcd 100644 --- a/src/SPC/command/dev/AllExtCommand.php +++ b/src/SPC/command/dev/AllExtCommand.php @@ -6,6 +6,7 @@ use SPC\command\BaseCommand; use SPC\exception\FileSystemException; +use SPC\exception\RuntimeException; use SPC\exception\WrongUsageException; use SPC\store\Config; use SPC\util\DependencyUtil; @@ -18,15 +19,17 @@ class AllExtCommand extends BaseCommand { public function configure(): void { - $this->addArgument('extensions', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Extension name', null); + $this->addArgument('extensions', InputArgument::OPTIONAL, 'List of extensions that will be displayed, comma separated'); } /** * @throws FileSystemException + * @throws WrongUsageException + * @throws RuntimeException */ public function handle(): int { - $extensions = $this->input->getArgument('extensions') ?: []; + $extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions') ?? ''))); $style = new SymfonyStyle($this->input, $this->output); $style->writeln($extensions ? 'Available extensions:' : 'Extensions:');