Skip to content

Commit a31a3f0

Browse files
authored
[console] Fix space with negative. (#232)
1 parent 45637cf commit a31a3f0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Descriptor/TextDescriptor.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,20 @@ protected function describeApplication(Application $application, array $options
254254
implode(',', $description->getCommand($name)->getAliases())
255255
);
256256
}
257+
257258
$spacingWidth = $width - strlen($name.$alias);
259+
if($spacingWidth < 0) {
260+
$spacingWidth = 0;
261+
}
262+
258263
$this->writeText(
259264
sprintf(
260265
' <info>%s</info> <comment>%s</comment> %s%s',
261266
$name,
262267
$alias,
263268
str_repeat(' ', $spacingWidth),
264-
$description->getCommand($name)->getDescription()
269+
$description->getCommand($name)->getDescription(
270+
)
265271
),
266272
$options
267273
);

0 commit comments

Comments
 (0)