Skip to content
Snippets Groups Projects
Commit dcf2e68b authored by Mathias Brodala's avatar Mathias Brodala Committed by Christian Kuhn
Browse files

[BUGFIX] Output dashed name for missing CLI arguments

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/34425


Reviewed-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Tested-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 09f6257c
No related merge requests found
......@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Extbase\Mvc\Controller;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
use TYPO3\CMS\Extbase\Mvc\Cli\CommandArgumentDefinition;
/**
* A controller which processes requests from the command line
......@@ -165,7 +166,8 @@ class CommandController implements CommandControllerInterface {
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(CommandArgumentDefinition::class, $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));
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment