mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding option parser to model task.
Adding omitted options to view task.
This commit is contained in:
parent
4985572f9b
commit
6b6d9e9b30
2 changed files with 19 additions and 63 deletions
|
@ -873,31 +873,25 @@ class ModelTask extends BakeTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays help contents
|
* get the option parser.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function help() {
|
public function getOptionParser() {
|
||||||
$this->hr();
|
$parser = parent::getOptionParser();
|
||||||
$this->out("Usage: cake bake model <arg1>");
|
return $parser->description(
|
||||||
$this->hr();
|
__('Bake models.')
|
||||||
$this->out('Arguments:');
|
)->addArgument('name', array(
|
||||||
$this->out();
|
'help' => __('Name of the model to bake. Can use Plugin.name to bake plugin models.')
|
||||||
$this->out("<name>");
|
))->addSubcommand('all', array(
|
||||||
$this->out("\tName of the model to bake. Can use Plugin.name");
|
'help' => __('Bake all model files with associations and validation.')
|
||||||
$this->out("\tas a shortcut for plugin baking.");
|
))->addOption('plugin', array(
|
||||||
$this->out();
|
'short' => 'p',
|
||||||
$this->out('Commands:');
|
'help' => __('Plugin to bake the model into.')
|
||||||
$this->out();
|
))->addOption('connection', array(
|
||||||
$this->out("model");
|
'short' => 'c',
|
||||||
$this->out("\tbakes model in interactive mode.");
|
'help' => __('The connection the model table is on.')
|
||||||
$this->out();
|
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
|
||||||
$this->out("model <name>");
|
|
||||||
$this->out("\tbakes model file with no associations or validation");
|
|
||||||
$this->out();
|
|
||||||
$this->out("model all");
|
|
||||||
$this->out("\tbakes all model files with associations and validation");
|
|
||||||
$this->out();
|
|
||||||
$this->_stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -420,46 +420,6 @@ class ViewTask extends BakeTask {
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays help contents
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function help() {
|
|
||||||
$this->hr();
|
|
||||||
$this->out("Usage: cake bake view <arg1> <arg2>...");
|
|
||||||
$this->hr();
|
|
||||||
$this->out('Arguments:');
|
|
||||||
$this->out();
|
|
||||||
$this->out("<controller>");
|
|
||||||
$this->out("\tName of the controller views to bake. Can use Plugin.name");
|
|
||||||
$this->out("\tas a shortcut for plugin baking.");
|
|
||||||
$this->out();
|
|
||||||
$this->out("<action>");
|
|
||||||
$this->out("\tName of the action view to bake");
|
|
||||||
$this->out();
|
|
||||||
$this->out('Commands:');
|
|
||||||
$this->out();
|
|
||||||
$this->out("view <controller>");
|
|
||||||
$this->out("\tWill read the given controller for methods");
|
|
||||||
$this->out("\tand bake corresponding views.");
|
|
||||||
$this->out("\tUsing the -admin flag will only bake views for actions");
|
|
||||||
$this->out("\tthat begin with Routing.prefixes.");
|
|
||||||
$this->out("\tIf var scaffold is found it will bake the CRUD actions");
|
|
||||||
$this->out("\t(index,view,add,edit)");
|
|
||||||
$this->out();
|
|
||||||
$this->out("view <controller> <action>");
|
|
||||||
$this->out("\tWill bake a template. core templates: (index, add, edit, view)");
|
|
||||||
$this->out();
|
|
||||||
$this->out("view <controller> <template> <alias>");
|
|
||||||
$this->out("\tWill use the template specified");
|
|
||||||
$this->out("\tbut name the file based on the alias");
|
|
||||||
$this->out();
|
|
||||||
$this->out("view all");
|
|
||||||
$this->out("\tBake all CRUD action views for all controllers.");
|
|
||||||
$this->out("\tRequires that models and controllers exist.");
|
|
||||||
$this->_stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the option parser for this task
|
* get the option parser for this task
|
||||||
*
|
*
|
||||||
|
@ -476,11 +436,13 @@ class ViewTask extends BakeTask {
|
||||||
))->addArgument('alias', array(
|
))->addArgument('alias', array(
|
||||||
'help' => __('Will bake the template in <action> but create the filename after <alias>.')
|
'help' => __('Will bake the template in <action> but create the filename after <alias>.')
|
||||||
))->addOption('plugin', array(
|
))->addOption('plugin', array(
|
||||||
|
'short' => 'p',
|
||||||
'help' => __('Plugin to bake the view into.')
|
'help' => __('Plugin to bake the view into.')
|
||||||
))->addOption('admin', array(
|
))->addOption('admin', array(
|
||||||
'help' => __('Set to only bake views for a prefix in Routing.prefixes'),
|
'help' => __('Set to only bake views for a prefix in Routing.prefixes'),
|
||||||
'boolean' => true
|
'boolean' => true
|
||||||
))->addOption('connection', array(
|
))->addOption('connection', array(
|
||||||
|
'short' => 'c',
|
||||||
'help' => __('The connection the connected model is on.')
|
'help' => __('The connection the connected model is on.')
|
||||||
))->addSubcommand('all', array(
|
))->addSubcommand('all', array(
|
||||||
'help' => __('Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
|
'help' => __('Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
|
||||||
|
|
Loading…
Add table
Reference in a new issue