Skip to content

Commit 058e2a8

Browse files
committed
Multiple arguments in module:status command
1 parent 62ffa42 commit 058e2a8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

setup/src/Magento/Setup/Console/Command/ModuleStatusCommand.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure()
4646
{
4747
$this->setName('module:status')
4848
->setDescription('Displays status of modules')
49-
->addArgument('module', InputArgument::OPTIONAL, 'Optional module name')
49+
->addArgument('module', InputArgument::OPTIONAL | InputArgument::IS_ARRAY , 'Optional module name')
5050
->addOption('enabled', null, null, 'Print only enabled modules')
5151
->addOption('disabled', null, null, 'Print only disabled modules');
5252
parent::configure();
@@ -57,9 +57,11 @@ protected function configure()
5757
*/
5858
protected function execute(InputInterface $input, OutputInterface $output)
5959
{
60-
$moduleName = (string)$input->getArgument('module');
61-
if ($moduleName) {
62-
return $this->showSpecificModule($moduleName, $output);
60+
$moduleNames = $input->getArgument('module');
61+
if (!empty($moduleNames)) {
62+
foreach($moduleNames as $moduleName)
63+
$this->showSpecificModule($moduleName, $output);
64+
return;
6365
}
6466

6567
$onlyEnabled = $input->getOption('enabled');
@@ -89,17 +91,17 @@ private function showSpecificModule(string $moduleName, OutputInterface $output)
8991
{
9092
$allModules = $this->getAllModules();
9193
if (!in_array($moduleName, $allModules->getNames())) {
92-
$output->writeln('<error>Module does not exist</error>');
94+
$output->writeln($moduleName.' : <error>Module does not exist</error>');
9395
return Cli::RETURN_FAILURE;
9496
}
9597

9698
$enabledModules = $this->getEnabledModules();
9799
if (in_array($moduleName, $enabledModules->getNames())) {
98-
$output->writeln('<info>Module is enabled</info>');
100+
$output->writeln($moduleName.' : <info>Module is enabled</info>');
99101
return Cli::RETURN_FAILURE;
100102
}
101103

102-
$output->writeln('<info>Module is disabled</info>');
104+
$output->writeln($moduleName.' : <info> Module is disabled</info>');
103105
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
104106
}
105107

0 commit comments

Comments
 (0)