Skip to content

Commit 7ca2395

Browse files
lsmith77fabpot
authored andcommitted
dump the list of available bundles (and extension alaises) if no name is provided
1 parent 5a8289e commit 7ca2395

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Command/ConfigDumpReferenceCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function configure()
3232
$this
3333
->setName('config:dump-reference')
3434
->setDefinition(array(
35-
new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias')
35+
new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias')
3636
))
3737
->setDescription('Dumps default configuration for an extension')
3838
->setHelp(<<<EOF
@@ -64,6 +64,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
6464

6565
$name = $input->getArgument('name');
6666

67+
if (empty($name)) {
68+
$output->writeln('Available registered bundles with their extension alias if available:');
69+
foreach ($bundles as $bundle) {
70+
$extension = $bundle->getContainerExtension();
71+
$output->writeln($bundle->getName().($extension ? ': '.$extension->getAlias() : ''));
72+
}
73+
74+
return;
75+
}
76+
6777
$extension = null;
6878

6979
if (preg_match('/Bundle$/', $name)) {

0 commit comments

Comments
 (0)