|
|
|
@ -473,7 +473,7 @@ class CommandLine {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (ReflectionException $e) {
|
|
|
|
|
$type = '<inconnu>';
|
|
|
|
|
$type = /** @lang text */'<inconnu>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw new InvalidArgumentException('L\'argument n\'est pas d\'un type géré : ' . $type);
|
|
|
|
@ -561,11 +561,11 @@ class CommandLine {
|
|
|
|
|
* @param boolean $exitAtEnd Terminer le script à la fin de la fonction correspondante ?
|
|
|
|
|
*/
|
|
|
|
|
public function treatDefaultArguments ($values, $exitAtEnd = true) {
|
|
|
|
|
if ($values->{self::ARGUMENT_OPTION_HELP} === true) {
|
|
|
|
|
if (isset($values->{self::ARGUMENT_OPTION_HELP}) && $values->{self::ARGUMENT_OPTION_HELP} === true) {
|
|
|
|
|
$this->showHelp($exitAtEnd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($values->{self::ARGUMENT_OPTION_VERSION} === true) {
|
|
|
|
|
if (isset($values->{self::ARGUMENT_OPTION_VERSION}) && $values->{self::ARGUMENT_OPTION_VERSION} === true) {
|
|
|
|
|
$this->showVersion($exitAtEnd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -613,7 +613,7 @@ class CommandLine {
|
|
|
|
|
$help[] = '';
|
|
|
|
|
|
|
|
|
|
$syntax = array(
|
|
|
|
|
$this->getCommand(),
|
|
|
|
|
empty($this->getCommand()) ? $this->getProgramName() : $this->getCommand(),
|
|
|
|
|
count($this->getOptions()) > 0 ? '[OPTIONS]' : '',
|
|
|
|
|
);
|
|
|
|
|
$syntax = array_merge($syntax, array_map(array(__CLASS__, '_getSyntaxOfValue'), $this->getValues()));
|
|
|
|
@ -854,6 +854,9 @@ class CommandLine {
|
|
|
|
|
return $out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(($arg = OptionAbstract::containsOption($argv)) !== false)
|
|
|
|
|
throw new IncorrectParse('Option inconnue : ' . $arg);
|
|
|
|
|
|
|
|
|
|
$values = array_values($this->getValues());
|
|
|
|
|
/**
|
|
|
|
|
* @var int $ordre
|