diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php index 57c7a75..344fc95 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php @@ -66,6 +66,12 @@ class CommandController implements CommandControllerInterface { protected $reflectionService; /** + * @var \TYPO3\CMS\Extbase\Service\EnvironmentService + * @inject + */ + protected $environmentService; + + /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface */ protected $objectManager; @@ -165,6 +171,10 @@ class CommandController implements CommandControllerInterface { 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)); }