Skip to content

Commit

Permalink
Adding OptionParser to view task.
Browse files Browse the repository at this point in the history
Adding epilog information about interactive mode to view and fixture tasks.
  • Loading branch information
markstory committed Oct 14, 2010
1 parent d3e4ced commit 50139b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cake/console/libs/tasks/fixture.php
Expand Up @@ -85,7 +85,7 @@ public function getOptionParser() {
'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.'));;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cake/console/libs/tasks/test.php
Expand Up @@ -426,6 +426,6 @@ public function getOptionParser() {
))->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.'));
}
}
27 changes: 27 additions & 0 deletions cake/console/libs/tasks/view.php
Expand Up @@ -460,6 +460,33 @@ public function help() {
$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.
*
Expand Down

0 comments on commit 50139b1

Please sign in to comment.