. */ namespace Doctrine\ORM\Tools\Cli\Tasks; use Doctrine\Common\Util\Inflector; /** * CLI Task to display available commands help * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.0 * @version $Revision$ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel */ class HelpTask extends AbstractTask { /** * @inheritdoc */ public function extendedHelp() { $this->run(); } /** * @inheritdoc */ public function basicHelp() { $this->run(); } /** * @inheritdoc */ public function validate() { return true; } /** * Exposes the available tasks * */ public function run() { $this->getPrinter()->writeln('Available Tasks:', 'NONE'); // Switch between ALL available tasks and display the basic Help of each one $availableTasks = $this->getAvailableTasks(); $helpTaskName = Inflector::classify(str_replace('-', '_', 'help')); unset($availableTasks[$helpTaskName]); ksort($availableTasks); foreach ($availableTasks as $taskName => $taskClass) { $task = new $taskClass(); $task->setAvailableTasks($availableTasks); $task->setPrinter($this->getPrinter()); $task->setArguments($this->getArguments()); $task->basicHelp(); } } }