protected function setArgumentHandlers()
{
parent::setArgumentHandlers()->addArgumentHandler(function ($script, $argument, $values) {
if (sizeof($values) !== 0) {
throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $argument, $script->getName()));
}
$script->help();
}, array('-h', '--help'), null, $this->locale->_('Display this help'))->addArgumentHandler(function ($script, $argument, $files) {
if (sizeof($files) <= 0) {
throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $argument, $script->getName()));
}
foreach ($files as $path) {
try {
$script->useConfigFile($path);
} catch (includer\exception $exception) {
throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Configuration file \'%s\' does not exist'), $path));
}
}
}, array('-c', '--configurations'), '<file>...', $this->locale->_('Use all configuration files <file>'), PHP_INT_MAX);
return $this;
}