mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding OptionParser to view task.
Adding epilog information about interactive mode to view and fixture tasks.
This commit is contained in:
parent
d3e4cedf12
commit
50139b153c
3 changed files with 29 additions and 2 deletions
|
@ -85,7 +85,7 @@ class FixtureTask extends BakeTask {
|
|||
'help' => 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10',
|
||||
'short' => 'r',
|
||||
'boolean' => true
|
||||
));
|
||||
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -426,6 +426,6 @@ class TestTask extends BakeTask {
|
|||
))->addOption('plugin', array(
|
||||
'short' => 'p',
|
||||
'help' => __('CamelCased name of the plugin to bake tests for.')
|
||||
));
|
||||
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -460,6 +460,33 @@ class ViewTask extends BakeTask {
|
|||
$this->_stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* get the option parser for this task
|
||||
*
|
||||
* @return ConsoleOptionParser
|
||||
*/
|
||||
public function getOptionParser() {
|
||||
$parser = parent::getOptionParser();
|
||||
return $parser->description(
|
||||
__('Bake views for a controller, using built-in or custom templates.')
|
||||
)->addArgument('controller', array(
|
||||
'help' => __('Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.')
|
||||
))->addArgument('action', array(
|
||||
'help' => __("Will bake a single action's file. core templates are (index, add, edit, view)")
|
||||
))->addArgument('alias', array(
|
||||
'help' => __('Will bake the template in <action> but create the filename after <alias>.')
|
||||
))->addOption('plugin', array(
|
||||
'help' => __('Plugin to bake the view into.')
|
||||
))->addOption('admin', array(
|
||||
'help' => __('Set to only bake views for a prefix in Routing.prefixes'),
|
||||
'boolean' => true
|
||||
))->addOption('connection', array(
|
||||
'help' => __('The connection the connected model is on.')
|
||||
))->addSubcommand('all', array(
|
||||
'help' => __('Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
|
||||
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns associations for controllers models.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue