From c30661736cf9840252ab2de1734b544eef7806a6 Mon Sep 17 00:00:00 2001 From: Jeremy Gonyea Date: Sat, 26 Oct 2024 10:18:43 -0400 Subject: [PATCH] Fix for #3164. Adds aliases as possible commands during lookup (#3863) --- .../Application/CommandLoader/PluginCommandLoader.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/src/Grav/Console/Application/CommandLoader/PluginCommandLoader.php b/system/src/Grav/Console/Application/CommandLoader/PluginCommandLoader.php index f550c518e..210250c64 100644 --- a/system/src/Grav/Console/Application/CommandLoader/PluginCommandLoader.php +++ b/system/src/Grav/Console/Application/CommandLoader/PluginCommandLoader.php @@ -57,6 +57,14 @@ class PluginCommandLoader implements CommandLoaderInterface $command = new $command_class(); if ($command instanceof Command) { $this->commands[$command->getName()] = $command; + + // If the command has an alias, add that as a possible command name. + $aliases = $this->commands[$command->getName()]->getAliases(); + if (isset($aliases)) { + foreach ($aliases as $alias) { + $this->commands[$alias] = $command; + } + } } } }