Commit da7af423 by Alexander Makarov

Added information about --appconfig to output of help command, color option is…

Added information about --appconfig to output of help command, color option is now passed to controller whose help we're getting
parent 21440d7a
...@@ -87,7 +87,7 @@ class Application extends \yii\base\Application ...@@ -87,7 +87,7 @@ class Application extends \yii\base\Application
* @param array $config the configuration provided in the constructor. * @param array $config the configuration provided in the constructor.
* @return array the actual configuration to be used by the application. * @return array the actual configuration to be used by the application.
*/ */
protected function loadConfig($config) // TODO should be available in HELP protected function loadConfig($config)
{ {
if (!empty($_SERVER['argv'])) { if (!empty($_SERVER['argv'])) {
$option = '--' . self::OPTION_APPCONFIG . '='; $option = '--' . self::OPTION_APPCONFIG . '=';
......
...@@ -213,7 +213,7 @@ class HelpController extends Controller ...@@ -213,7 +213,7 @@ class HelpController extends Controller
*/ */
protected function getControllerHelp($controller) protected function getControllerHelp($controller)
{ {
// TODO set color option of controller to this controllers color option $controller->color = $this->color;
$this->stdout("\nDESCRIPTION\n", Console::BOLD); $this->stdout("\nDESCRIPTION\n", Console::BOLD);
$comment = $controller->getHelp(); $comment = $controller->getHelp();
...@@ -398,6 +398,15 @@ class HelpController extends Controller ...@@ -398,6 +398,15 @@ class HelpController extends Controller
$options[$name] = $this->formatOptionHelp($this->ansiFormat('--' . $name, Console::FG_RED), false, null, $defaultValue, ''); $options[$name] = $this->formatOptionHelp($this->ansiFormat('--' . $name, Console::FG_RED), false, null, $defaultValue, '');
} }
} }
$name = \yii\console\Application::OPTION_APPCONFIG;
$options[$name] = $this->formatOptionHelp(
$this->ansiFormat('--' . $name, Console::FG_RED),
false,
'string',
null,
"custom application configuration file path.\nIf not set, default application configuration is used."
);
ksort($options); ksort($options);
return $options; return $options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment