From 11810e3c2de5a0e24e34ce235bb713151e7ca0cb Mon Sep 17 00:00:00 2001 From: JDev4U Date: Wed, 13 Oct 2021 22:03:31 +0200 Subject: [PATCH] Fix help command not working with plugin commands, fixes #10147 (#10150) - Add 'help' in the list of commands that need plugin command ($mayNeedPluginCommand) - Remove `'global' !== $commandName` because $mayNeedPluginCommand encure that $commandName is one of `false`, `empty`, `list` or `help` (so never 'global') Co-authored-by: Duret Joel --- src/Composer/Console/Application.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index bdc9b2a32..5c104737b 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -196,10 +196,10 @@ class Application extends BaseApplication // not a composer command, so try loading plugin ones false === $commandName // list command requires plugin commands to show them - || in_array($commandName, array('', 'list'), true) + || in_array($commandName, array('', 'list', 'help'), true) ); - if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) { + if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands) { try { foreach ($this->getPluginCommands() as $command) { if ($this->has($command->getName())) {