Enh: yii fixture command now offers help if no arguments are provided instead of crashing

This commit is contained in:
Alexander Makarov
2014-11-28 00:31:53 +03:00
parent 7325fdd7ed
commit 19af264530
3 changed files with 15 additions and 5 deletions

View File

@ -91,6 +91,15 @@ class FixtureController extends Controller
public function actionLoad()
{
$fixturesInput = func_get_args();
if ($fixturesInput === []) {
$this->stdout($this->getHelpSummary() . "\n");
$helpCommand = Console::ansiFormat("yii help fixture", [Console::FG_CYAN]);
$this->stdout("Use $helpCommand to get usage info.\n");
return self::EXIT_CODE_NORMAL;
}
$filtered = $this->filterFixtures($fixturesInput);
$except = $filtered['except'];