[TASK] Add available commands to console output 75/47475/7
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 31 Mar 2016 20:49:52 +0000 (22:49 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 8 Dec 2016 20:25:42 +0000 (21:25 +0100)
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 <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Console/CommandRequestHandler.php

index 5ae7a6c..fecfa98 100644 (file)
@@ -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;
     }
 
     /**