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();
}
}