From 1c2f24e10eda07943daa31d3c1ad0634f4bbf6e8 Mon Sep 17 00:00:00 2001 From: Wouter Wolters Date: Thu, 31 Mar 2016 22:49:52 +0200 Subject: [PATCH] [TASK] Add available commands to console output When no valid key or command is given only the cliKeys are written on the CLI. Now the available commands are written as well. Resolves: #75350 Releases: master Change-Id: If8102649128cf663831022b7b75a5150daa91649 Reviewed-on: https://review.typo3.org/47475 Reviewed-by: Susanne Moog Tested-by: Susanne Moog Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../Classes/Console/CommandRequestHandler.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/core/Classes/Console/CommandRequestHandler.php b/typo3/sysext/core/Classes/Console/CommandRequestHandler.php index 5ae7a6c0b3c2..fecfa9865aa6 100644 --- a/typo3/sysext/core/Classes/Console/CommandRequestHandler.php +++ b/typo3/sysext/core/Classes/Console/CommandRequestHandler.php @@ -80,6 +80,19 @@ class CommandRequestHandler implements RequestHandlerInterface // Make sure output is not buffered, so command-line output and interaction can take place $this->bootstrap->endOutputBufferingAndCleanPreviousOutput(); + + if (!$command) { + $cliKeys = array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']); + + $output->writeln('Old entrypoint keys available:'); + asort($cliKeys); + foreach ($cliKeys as $key => $value) { + $output->writeln(' ' . $value); + } + $output->writeln(''); + $output->writeln('TYPO3 Console Commands:'); + } + $exitCode = $this->application->run($input, $output); exit($exitCode); } @@ -105,7 +118,7 @@ class CommandRequestHandler implements RequestHandlerInterface } /** - * This request handler can handle any CLI request, but checks for + * This request handler can handle any CLI request * * @param InputInterface $input * @return bool Always TRUE @@ -113,7 +126,7 @@ class CommandRequestHandler implements RequestHandlerInterface public function canHandleRequest(InputInterface $input) { $this->populateAvailableCommands(); - return $this->getCommandToRun($input) !== false; + return true; } /** -- 2.20.1