Skip to content

Commit

Permalink
[TASK] Show command of console commands in backend
Browse files Browse the repository at this point in the history
Show the console command and arguments in the backend of symfony commands.

Resolves: #88788
Releases: master, 9.5
Change-Id: Ief0abb4404c14dbfa85eb4acddcb74e796ba0272
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61271
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
georgringer authored and andreaskienast committed Jul 22, 2019
1 parent e83bb5f commit dc08d6d
Showing 1 changed file with 28 additions and 0 deletions.
Expand Up @@ -91,6 +91,34 @@ public function execute(): bool
return $schedulableCommand->run($input, $output) === 0;
}

/**
* Return a text representation of the selected command and arguments
*
* @return string Information to display
*/
public function getAdditionalInformation(): string
{
$label = $this->commandIdentifier;

try {
$commandRegistry = GeneralUtility::makeInstance(CommandRegistry::class);
$schedulableCommand = $commandRegistry->getCommandByIdentifier($this->commandIdentifier);
} catch (UnknownCommandException $e) {
return sprintf(
$this->getLanguageService()->sL('LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:msg.unregisteredCommand'),
$this->commandIdentifier
);
}

$input = new ArrayInput($this->getArguments(), $schedulableCommand->getDefinition());
$arguments = $input->__toString();
if ($arguments !== '') {
$label .= ' ' . $arguments;
}

return $label;
}

/**
* @return array
*/
Expand Down

0 comments on commit dc08d6d

Please sign in to comment.