From 02720810af5ee614b24e94b94c1733dd9c8b10b3 Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Mon, 23 Jan 2017 08:21:33 -0800 Subject: [PATCH] [list] Show global namespace commands. (#141) --- src/Descriptor/TextDescriptor.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Descriptor/TextDescriptor.php b/src/Descriptor/TextDescriptor.php index a0accedca..002b1473e 100644 --- a/src/Descriptor/TextDescriptor.php +++ b/src/Descriptor/TextDescriptor.php @@ -188,16 +188,33 @@ protected function describeApplication(Application $application, array $options else { $this->writeText($application->trans('commands.list.messages.available-commands'), $options); } + + $singleCommands = [ + 'about', + 'chain', + 'check', + 'exec', + 'help', + 'init', + 'list', + 'shell', + 'server' + ]; + // add commands by namespace foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE == $namespace['id']){ - continue; - } if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { $this->writeText("\n"); $this->writeText(' '.$namespace['id'].'', $options); } foreach ($namespace['commands'] as $name) { + + if (ApplicationDescription::GLOBAL_NAMESPACE == $namespace['id']){ + if (!in_array($name, $singleCommands)) { + continue; + } + } + $this->writeText("\n"); $alias = ''; if ($description->getCommand($name)->getAliases()){