Skip to content

Commit

Permalink
Clean up argument formatting in help command.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Aug 25, 2024
1 parent f95387b commit 52af7f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ private function argumentsAsText(): string
$default = '';
}

$name = $argument->getName();
$pad = \str_pad('', $max - \strlen($name));
$description = \str_replace("\n", "\n".\str_pad('', $max + 2, ' '), $argument->getDescription());

$messages[] = \sprintf(" <info>%-{$max}s</info> %s%s", $argument->getName(), $description, $default);
$messages[] = \sprintf(' <info>%s</info>%s %s%s', $name, $pad, $description, $default);
}

$messages[] = '';
Expand Down

0 comments on commit 52af7f5

Please sign in to comment.