if ($option->
acceptValue()) { $value = '='.
strtoupper($option->
getName());
if ($option->
isValueOptional()) { $value = '['.
$value.']';
} } $totalWidth =
$options['total_width'
] ??
$this->
calculateTotalWidthForOptions([$option]);
$synopsis =
sprintf('%s%s',
$option->
getShortcut() ?
sprintf('-%s, ',
$option->
getShortcut()) : ' ',
sprintf($option->
isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s',
$option->
getName(),
$value) );
$spacingWidth =
$totalWidth - Helper::
width($synopsis);
$this->
writeText(sprintf(' <info>%s</info> %s%s%s%s',
$synopsis,
str_repeat(' ',
$spacingWidth),
// + 4 = 2 spaces before <info>, 2 spaces after </info>
preg_replace('/\s*[\r\n]\s*/', "\n".
str_repeat(' ',
$totalWidth + 4
),
$option->
getDescription()),
$default,
$option->
isArray() ? '<comment> (multiple values allowed)</comment>' : ''
),