Skip to content

Commit 4517972

Browse files
committedNov 26, 2021
style: update some for help render
1 parent 973fd28 commit 4517972

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/Util/FormatUtil.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use function strpos;
3434
use function trim;
3535
use function ucfirst;
36+
use function vdump;
3637
use function wordwrap;
3738
use const STR_PAD_RIGHT;
3839

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

151152
// e.g '-h, --help'
152153
$hasShort = (bool)strpos(implode('', array_keys($options)), ',');
153-
154154
if (!$hasShort) {
155155
return $options;
156156
}
@@ -161,8 +161,8 @@ public static function alignOptions(array $options): array
161161
continue;
162162
}
163163

164-
// padding length equals to '-h, '
165-
if (!str_contains($name, ',')) {
164+
// start with '--', padding length equals to '-h, '
165+
if (isset($name[1]) && $name[1] === '-') {
166166
$name = ' ' . $name;
167167
} else {
168168
$name = str_replace([',-'], [', -'], $name);

0 commit comments

Comments
 (0)