Project

General

Profile

Task #61630 ยป command-argument-dashed.patch

Show dashed command argument name - Mathias Brodala, 2014-09-16 11:41

View differences:

typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php
protected $reflectionService;
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
*/
protected $objectManager;
......
if ($this->request->hasArgument($argumentName)) {
$argument->setValue($this->request->getArgument($argumentName));
} elseif ($argument->isRequired()) {
if ($this->environmentService->isEnvironmentInCliMode()) {
$commandArgumentDefinition = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', $argumentName, TRUE, NULL);
$argumentName = $commandArgumentDefinition->getDashedName();
}
$exception = new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException('Required argument "' . $argumentName . '" is not set.', 1306755520);
$this->forward('error', 'TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', array('exception' => $exception));
}
    (1-1/1)