Skip to content

Commit

Permalink
style: update some for help render
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 26, 2021
1 parent 973fd28 commit 4517972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Util/FormatUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use function strpos;
use function trim;
use function ucfirst;
use function vdump;
use function wordwrap;
use const STR_PAD_RIGHT;

Expand Down Expand Up @@ -150,7 +151,6 @@ public static function alignOptions(array $options): array

// e.g '-h, --help'
$hasShort = (bool)strpos(implode('', array_keys($options)), ',');

if (!$hasShort) {
return $options;
}
Expand All @@ -161,8 +161,8 @@ public static function alignOptions(array $options): array
continue;
}

// padding length equals to '-h, '
if (!str_contains($name, ',')) {
// start with '--', padding length equals to '-h, '
if (isset($name[1]) && $name[1] === '-') {
$name = ' ' . $name;
} else {
$name = str_replace([',-'], [', -'], $name);
Expand Down

0 comments on commit 4517972

Please sign in to comment.