diff --git a/src/System/Integrate/Console/HelpCommand.php b/src/System/Integrate/Console/HelpCommand.php index 5179d0fc..01cdfcf3 100644 --- a/src/System/Integrate/Console/HelpCommand.php +++ b/src/System/Integrate/Console/HelpCommand.php @@ -167,7 +167,9 @@ public function commandList(): int $maks1 = 0; $maks2 = 0; foreach ($this->commandMaps() as $command) { - $lenght = Str::length(implode(', ', $command->patterns())); + $option = array_merge($command->cmd(), $command->patterns()); + $lenght = Str::length(implode(', ', $option)); + if ($lenght > $maks1) { $maks1 = $lenght; } @@ -179,9 +181,10 @@ public function commandList(): int } foreach ($this->commandMaps() as $command) { - style(implode(', ', $command->patterns()))->textLightYellow()->out(false); + $option = array_merge($command->cmd(), $command->patterns()); + style(implode(', ', $option))->textLightYellow()->out(false); - $lenght1 = Str::length(implode(', ', $command->patterns())); + $lenght1 = Str::length(implode(', ', $option)); $lenght2 = Str::length($command->class()); style('') ->repeat(' ', $maks1 - $lenght1 + 4) diff --git a/src/System/Integrate/ValueObjects/CommandMap.php b/src/System/Integrate/ValueObjects/CommandMap.php index bd6067fb..c0197977 100644 --- a/src/System/Integrate/ValueObjects/CommandMap.php +++ b/src/System/Integrate/ValueObjects/CommandMap.php @@ -34,6 +34,9 @@ public function __construct(array $command) */ public function cmd() { + if (false === array_key_exists('cmd', $this->command)) { + return []; + } $cmd = $this->command['cmd']; return is_array($cmd) ? $cmd : [$cmd];