Fix options alignment in help

master
Julien Rosset 6 years ago
parent 44e008fdc7
commit 382b554be6

@ -473,7 +473,8 @@ class CommandLine {
}
}
catch (ReflectionException $e) {
$type = /** @lang text */'<inconnu>';
$type = /** @lang text */
'<inconnu>';
}
throw new InvalidArgumentException('L\'argument n\'est pas d\'un type géré : ' . $type);
@ -723,13 +724,17 @@ class CommandLine {
STR_PAD_RIGHT
);
$entries[] = self::TAB . implode(self::TAB, array(
$entries[] = self::TAB . implode(
self::TAB,
array(
$label,
$occur,
$valueDescription,
preg_replace(
/** @lang RegExp */ '@\r?\n@',
'$0' . self::TAB . implode(self::TAB, array(
'@\r?\n@',
'$0' . self::TAB . implode(
self::TAB,
array(
str_pad('', $pads->name, ' '),
str_pad('', $pads->occurMin + 4 + $pads->occurMax, ' '),
str_pad('', $pads->valueDescription, ' '),
@ -798,12 +803,16 @@ class CommandLine {
STR_PAD_RIGHT
);
$entries[] = self::TAB . self::TAB . implode(self::TAB, array(
$entries[] = self::TAB . implode(
self::TAB,
array(
$label,
$valueDescription,
preg_replace(
/** @lang RegExp */ '@\r?\n@',
'$0' . self::TAB . self::TAB . implode(self::TAB, array(
'@\r?\n@',
'$0' . self::TAB . self::TAB . implode(
self::TAB,
array(
str_pad('', $pads->tagShort + 1 + $pads->tagLong + 2, ' '),
str_pad('', $pads->valueDescription, ' '),
'',
@ -854,8 +863,9 @@ class CommandLine {
return $out;
}
if(($arg = OptionAbstract::containsOption($argv)) !== false)
if (($arg = OptionAbstract::containsOption($argv)) !== false) {
throw new IncorrectParse('Option inconnue : ' . $arg);
}
$values = array_values($this->getValues());
/**

Loading…
Cancel
Save