[BUGFIX] Output dashed name for missing CLI arguments 49/34449/4
authorMathias Brodala <mbrodala@pagemachine.de>
Fri, 21 Nov 2014 07:59:33 +0000 (08:59 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 21 Nov 2014 15:10:11 +0000 (16:10 +0100)
This changes the command argument name outputted on errors from variable
naming to dashed notation as used on the CLI.

Resolves: #61630
Releases: 6.2, master
Change-Id: Ie41c90c056505df859aec3ee306718c874dd8a05
Reviewed-on: http://review.typo3.org/34449
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php

index ca1a96d..c140379 100644 (file)
@@ -164,7 +164,8 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
                        if ($this->request->hasArgument($argumentName)) {
                                $argument->setValue($this->request->getArgument($argumentName));
                        } elseif ($argument->isRequired()) {
-                               $exception = new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException('Required argument "' . $argumentName . '" is not set.', 1306755520);
+                               $commandArgumentDefinition = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', $argumentName, TRUE, NULL);
+                               $exception = new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException('Required argument "' . $commandArgumentDefinition->getDashedName() . '" is not set.', 1306755520);
                                $this->forward('error', 'TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', array('exception' => $exception));
                        }
                }