cli Alias support in 1.7

This commit is contained in:
Andy Miller 2024-10-27 12:24:39 +00:00
parent a0614dc3eb
commit 6b07088189
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0

View File

@ -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;
}
}
}
}
}