mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -761,6 +761,21 @@ class Application implements ResetInterface
|
||||
}));
|
||||
}
|
||||
|
||||
// check whether all commands left are aliases to the same one
|
||||
if (\count($commands) > 1) {
|
||||
$uniqueCommands = array_unique(array_map(function ($nameOrAlias) use (&$commandList) {
|
||||
if (!$commandList[$nameOrAlias] instanceof Command) {
|
||||
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
|
||||
}
|
||||
|
||||
return $commandList[$nameOrAlias]->getName();
|
||||
}, $commands));
|
||||
|
||||
if (1 === \count($uniqueCommands)) {
|
||||
$commands = [reset($uniqueCommands)];
|
||||
}
|
||||
}
|
||||
|
||||
if (\count($commands) > 1) {
|
||||
$usableWidth = $this->terminal->getWidth() - 10;
|
||||
$abbrevs = array_values($commands);
|
||||
|
||||
Reference in New Issue
Block a user