Skip to content

Commit

Permalink
cli Alias support in 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 27, 2024
1 parent a0614dc commit 6b07088
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public function __construct(string $name)
$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;
}
}
}
}
}
Expand Down

0 comments on commit 6b07088

Please sign in to comment.