Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/SPC/command/dev/AllExtCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:');
Expand Down