yii\console\controllers\HelpController::actionIndex PHP Method

actionIndex() public method

Displays available commands or the detailed information about a particular command.
public actionIndex ( string $command = null ) : integer
$command string The name of the command to show help about. If not provided, all available commands will be displayed.
return integer the exit status
    public function actionIndex($command = null)
    {
        if ($command !== null) {
            $result = Yii::$app->createController($command);
            if ($result === false) {
                $name = $this->ansiFormat($command, Console::FG_YELLOW);
                throw new Exception("No help for unknown command \"{$name}\".");
            }
            list($controller, $actionID) = $result;
            $actions = $this->getActions($controller);
            if ($actionID !== '' || count($actions) === 1 && $actions[0] === $controller->defaultAction) {
                $this->getSubCommandHelp($controller, $actionID);
            } else {
                $this->getCommandHelp($controller);
            }
        } else {
            $this->getDefaultHelp();
        }
    }