Set console options in the same fashion for every shell/task.

This commit is contained in:
Ber Clausen 2013-12-05 20:38:32 -03:00
parent 8578708e76
commit 5c08c77b93
22 changed files with 470 additions and 426 deletions

View file

@ -356,9 +356,9 @@ class AclShell extends AppShell {
}
/**
* Get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
@ -494,8 +494,7 @@ class AclShell extends AppShell {
)
))->addSubcommand('initdb', array(
'help' => __d('cake_console', 'Initialize the DbAcl tables. Uses this command : cake schema create DbAcl')
))->epilog(
array(
))->epilog(array(
'Node and parent arguments can be in one of the following formats:',
'',
' - <model>.<id> - The node will be bound to a specific record of the given model.',
@ -505,8 +504,8 @@ class AclShell extends AppShell {
" i.e. <group>/<subgroup>/<parent>.",
'',
"To add a node at the root level, enter 'root' or '/' as the <parent> parameter."
)
);
));
return $parser;
}

View file

@ -137,20 +137,24 @@ class ApiShell extends AppShell {
}
/**
* Get and configure the optionparser.
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->addArgument('type', array(
$parser->description(
__d('cake_console', 'Lookup doc block comments for classes in CakePHP.')
)->addArgument('type', array(
'help' => __d('cake_console', 'Either a full path or type of class (model, behavior, controller, component, view, helper)')
))->addArgument('className', array(
'help' => __d('cake_console', 'A CakePHP core class name (e.g: Component, HtmlHelper).')
))->addOption('method', array(
'short' => 'm',
'help' => __d('cake_console', 'The specific method you want help on.')
))->description(__d('cake_console', 'Lookup doc block comments for classes in CakePHP.'));
));
return $parser;
}

View file

@ -203,18 +203,19 @@ class BakeShell extends AppShell {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console',
'The Bake script generates controllers, views and models for your application.' .
$parser->description(
__d('cake_console', 'The Bake script generates controllers, views and models for your application.' .
' If run with no command line arguments, Bake guides the user through the class creation process.' .
' You can customize the generation process by telling Bake where different parts of your application are using command line arguments.'
))->addSubcommand('all', array(
'help' => __d('cake_console', 'Bake a complete MVC. optional <name> of a Model'),
' You can customize the generation process by telling Bake where different parts of your application are using command line arguments.')
)->addSubcommand('all', array(
'help' => __d('cake_console', 'Bake a complete MVC. optional <name> of a Model')
))->addSubcommand('project', array(
'help' => __d('cake_console', 'Bake a new app folder in the path supplied or in current directory if no path is specified'),
'parser' => $this->Project->getOptionParser()
@ -247,6 +248,8 @@ class BakeShell extends AppShell {
'short' => 't',
'help' => __d('cake_console', 'Theme to use when baking code.')
));
return $parser;
}
}

View file

@ -120,21 +120,24 @@ class CommandListShell extends AppShell {
}
/**
* get the option parser
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'Get the list of available shells for this CakePHP application.'))
->addOption('sort', array(
$parser->description(
__d('cake_console', 'Get the list of available shells for this CakePHP application.')
)->addOption('sort', array(
'help' => __d('cake_console', 'Does nothing (deprecated)'),
'boolean' => true
))
->addOption('xml', array(
))->addOption('xml', array(
'help' => __d('cake_console', 'Get the listing as XML.'),
'boolean' => true
));
return $parser;
}
}

View file

@ -96,15 +96,16 @@ class CompletionShell extends AppShell {
}
/**
* getOptionParser for _this_ shell
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->description(__d('cake_console', 'Used by shells like bash to autocomplete command name, options and arguments'))
->addSubcommand('commands', array(
$parser->description(
__d('cake_console', 'Used by shells like bash to autocomplete command name, options and arguments')
)->addSubcommand('commands', array(
'help' => __d('cake_console', 'Output a list of available commands'),
'parser' => array(
'description' => __d('cake_console', 'List all availables'),
@ -134,10 +135,9 @@ class CompletionShell extends AppShell {
)
)
))->epilog(
array(
__d('cake_console', 'This command is not intended to be called manually'),
)
__d('cake_console', 'This command is not intended to be called manually')
);
return $parser;
}

View file

@ -105,19 +105,19 @@ class ConsoleShell extends AppShell {
}
/**
* getOptionParser
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$description = array(
$parser = parent::getOptionParser();
$parser->description(array(
'The interactive console is a tool for testing parts of your',
'app before you write code.',
'',
'See below for a list of supported commands.'
);
$epilog = array(
))->epilog(array(
'<info>Model testing</info>',
'',
'To test model results, use the name of your model without a leading $',
@ -176,10 +176,9 @@ class ConsoleShell extends AppShell {
'To show all connected routes, do the following:',
'',
"\tRoutes show",
);
return parent::getOptionParser()
->description($description)
->epilog($epilog);
));
return $parser;
}
/**
* Prints the help message

View file

@ -100,13 +100,14 @@ class I18nShell extends AppShell {
}
/**
* Get and configure the Option parser
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.')
)->addSubcommand('initdb', array(
'help' => __d('cake_console', 'Initialize the i18n table.')
@ -114,6 +115,8 @@ class I18nShell extends AppShell {
'help' => __d('cake_console', 'Extract the po translations from your application'),
'parser' => $this->Extract->getOptionParser()
));
return $parser;
}
}

View file

@ -457,11 +457,13 @@ class SchemaShell extends AppShell {
}
/**
* get the option parser
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$plugin = array(
'short' => 'p',
'help' => __d('cake_console', 'The plugin to use.'),
@ -515,11 +517,8 @@ class SchemaShell extends AppShell {
'boolean' => true
);
$parser = parent::getOptionParser();
$parser->description(
__d('cake_console',
'The Schema Shell generates a schema object from the database and updates the database from the schema.'
)
__d('cake_console', 'The Schema Shell generates a schema object from the database and updates the database from the schema.')
)->addSubcommand('view', array(
'help' => __d('cake_console', 'Read and output the contents of a schema file'),
'parser' => array(
@ -567,6 +566,7 @@ class SchemaShell extends AppShell {
)
)
));
return $parser;
}

View file

@ -137,29 +137,25 @@ class ServerShell extends AppShell {
}
/**
* Get and configure the optionparser.
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->addOption('host', array(
'short' => 'H',
'help' => __d('cake_console', 'ServerHost')
));
$parser->addOption('port', array(
'short' => 'p',
'help' => __d('cake_console', 'ListenPort')
));
$parser->addOption('document_root', array(
'short' => 'd',
'help' => __d('cake_console', 'DocumentRoot')
));
$parser->description(array(
__d('cake_console', 'PHP Built-in Server for CakePHP'),
__d('cake_console', '<warning>[WARN] Don\'t use this at the production environment</warning>'),
__d('cake_console', '<warning>[WARN] Don\'t use this at the production environment</warning>')
))->addOption('host', array(
'short' => 'H',
'help' => __d('cake_console', 'ServerHost')
))->addOption('port', array(
'short' => 'p',
'help' => __d('cake_console', 'ListenPort')
))->addOption('document_root', array(
'short' => 'd',
'help' => __d('cake_console', 'DocumentRoot')
));
return $parser;

View file

@ -456,15 +456,16 @@ class ControllerTask extends BakeTask {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__d('cake_console', 'Bake a controller for a model. Using options you can bake public, admin or both.')
)->addArgument('name', array(
$parser->description(
__d('cake_console', 'Bake a controller for a model. Using options you can bake public, admin or both.'
))->addArgument('name', array(
'help' => __d('cake_console', 'Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.')
))->addOption('public', array(
'help' => __d('cake_console', 'Bake a controller with basic crud actions (index, view, add, edit, delete).'),
@ -486,7 +487,11 @@ class ControllerTask extends BakeTask {
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
))->addSubcommand('all', array(
'help' => __d('cake_console', 'Bake all controllers with CRUD methods.')
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
))->epilog(
__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')
);
return $parser;
}
}

View file

@ -368,15 +368,18 @@ class DbConfigTask extends AppShell {
}
/**
* get the option parser
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'Bake new database configuration settings.')
);
return $parser;
}
}

View file

@ -296,52 +296,55 @@ class ExtractTask extends AppShell {
}
/**
* Get & configure the option parser
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'CakePHP Language String Extraction:'))
->addOption('app', array('help' => __d('cake_console', 'Directory where your application is located.')))
->addOption('paths', array('help' => __d('cake_console', 'Comma separated list of paths.')))
->addOption('merge', array(
$parser->description(
__d('cake_console', 'CakePHP Language String Extraction:')
)->addOption('app', array(
'help' => __d('cake_console', 'Directory where your application is located.')
))->addOption('paths', array(
'help' => __d('cake_console', 'Comma separated list of paths.')
))->addOption('merge', array(
'help' => __d('cake_console', 'Merge all domain and category strings into the default.po file.'),
'choices' => array('yes', 'no')
))
->addOption('output', array('help' => __d('cake_console', 'Full path to output directory.')))
->addOption('files', array('help' => __d('cake_console', 'Comma separated list of files.')))
->addOption('exclude-plugins', array(
))->addOption('output', array(
'help' => __d('cake_console', 'Full path to output directory.')
))->addOption('files', array(
'help' => __d('cake_console', 'Comma separated list of files.')
))->addOption('exclude-plugins', array(
'boolean' => true,
'default' => true,
'help' => __d('cake_console', 'Ignores all files in plugins if this command is run inside from the same app directory.')
))
->addOption('plugin', array(
))->addOption('plugin', array(
'help' => __d('cake_console', 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.')
))
->addOption('ignore-model-validation', array(
))->addOption('ignore-model-validation', array(
'boolean' => true,
'default' => false,
'help' => __d('cake_console', 'Ignores validation messages in the $validate property.' .
' If this flag is not set and the command is run from the same app directory,' .
' all messages in model validation rules will be extracted as tokens.')
))
->addOption('validation-domain', array(
' all messages in model validation rules will be extracted as tokens.'
)
))->addOption('validation-domain', array(
'help' => __d('cake_console', 'If set to a value, the localization domain to be used for model validation messages.')
))
->addOption('exclude', array(
))->addOption('exclude', array(
'help' => __d('cake_console', 'Comma separated list of directories to exclude.' .
' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')
))
->addOption('overwrite', array(
' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors'
)
))->addOption('overwrite', array(
'boolean' => true,
'default' => false,
'help' => __d('cake_console', 'Always overwrite existing .pot files.')
))
->addOption('extract-core', array(
))->addOption('extract-core', array(
'help' => __d('cake_console', 'Extract messages from the CakePHP core libs.'),
'choices' => array('yes', 'no')
));
return $parser;
}
/**

View file

@ -60,13 +60,14 @@ class FixtureTask extends BakeTask {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.')
)->addArgument('name', array(
'help' => __d('cake_console', 'Name of the fixture to bake. Can use Plugin.name to bake plugin fixtures.')
@ -80,7 +81,7 @@ class FixtureTask extends BakeTask {
'default' => 'default'
))->addOption('plugin', array(
'help' => __d('cake_console', 'CamelCased name of the plugin to bake fixtures for.'),
'short' => 'p',
'short' => 'p'
))->addOption('schema', array(
'help' => __d('cake_console', 'Importing schema for fixtures rather than hardcoding it.'),
'short' => 's',
@ -92,10 +93,15 @@ class FixtureTask extends BakeTask {
'short' => 'f',
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
))->addOption('records', array(
'help' => __d('cake_console', '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.'),
'help' => __d('cake_console', '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(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
))->epilog(
__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')
);
return $parser;
}
/**

View file

@ -999,13 +999,14 @@ class ModelTask extends BakeTask {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'Bake models.')
)->addArgument('name', array(
'help' => __d('cake_console', 'Name of the model to bake. Can use Plugin.name to bake plugin models.')
@ -1023,7 +1024,11 @@ class ModelTask extends BakeTask {
))->addOption('force', array(
'short' => 'f',
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
))->epilog(
__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')
);
return $parser;
}
/**

View file

@ -209,18 +209,21 @@ class PluginTask extends AppShell {
}
/**
* get the option parser for the plugin task
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console',
'Create the directory structure, AppModel and AppController classes for a new plugin. ' .
'Can create plugins in any of your bootstrapped plugin paths.'
))->addArgument('name', array(
$parser->description(
__d('cake_console', 'Create the directory structure, AppModel and AppController classes for a new plugin. ' .
'Can create plugins in any of your bootstrapped plugin paths.')
)->addArgument('name', array(
'help' => __d('cake_console', 'CamelCased name of the plugin to create.')
));
return $parser;
}
}

View file

@ -419,13 +419,14 @@ class ProjectTask extends AppShell {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'Generate a new CakePHP project skeleton.')
)->addArgument('name', array(
'help' => __d('cake_console', 'Application directory to make, if it starts with "/" the path is absolute.')
@ -437,8 +438,11 @@ class ProjectTask extends AppShell {
'help' => __d('cake_console', 'Theme to use when baking code.')
))->addOption('skel', array(
'default' => current(App::core('Console')) . 'Templates' . DS . 'skel',
'help' => __d('cake_console', 'The directory layout to use for the new application skeleton. Defaults to cake/Console/Templates/skel of CakePHP used to create the project.')
'help' => __d('cake_console', 'The directory layout to use for the new application skeleton.' .
' Defaults to cake/Console/Templates/skel of CakePHP used to create the project.')
));
return $parser;
}
}

View file

@ -543,14 +543,16 @@ class TestTask extends BakeTask {
}
/**
* get the option parser.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'Bake test case skeletons for classes.'))
->addArgument('type', array(
$parser->description(
__d('cake_console', 'Bake test case skeletons for classes.')
)->addArgument('type', array(
'help' => __d('cake_console', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'),
'choices' => array(
'Controller', 'controller',
@ -570,7 +572,11 @@ class TestTask extends BakeTask {
))->addOption('force', array(
'short' => 'f',
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
))->epilog(
__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')
);
return $parser;
}
}

View file

@ -412,13 +412,14 @@ class ViewTask extends BakeTask {
}
/**
* get the option parser for this task
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
$parser->description(
__d('cake_console', 'Bake views for a controller, using built-in or custom templates.')
)->addArgument('controller', array(
'help' => __d('cake_console', 'Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.')
@ -443,7 +444,11 @@ class ViewTask extends BakeTask {
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
))->addSubcommand('all', array(
'help' => __d('cake_console', 'Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
))->epilog(
__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.')
);
return $parser;
}
/**

View file

@ -38,20 +38,21 @@ class TestShell extends Shell {
protected $_dispatcher = null;
/**
* get the option parser for the test suite.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = new ConsoleOptionParser($this->name);
$parser->description(array(
__d('cake_console', 'The CakePHP Testsuite allows you to run test cases from the command line'),
))->addArgument('category', array(
$parser->description(
__d('cake_console', 'The CakePHP Testsuite allows you to run test cases from the command line')
)->addArgument('category', array(
'help' => __d('cake_console', 'The category for the test, or test file, to test.'),
'required' => false,
'required' => false
))->addArgument('file', array(
'help' => __d('cake_console', 'The path to the file, or test file, to test.'),
'required' => false,
'required' => false
))->addOption('log-junit', array(
'help' => __d('cake_console', '<file> Log test execution in JUnit XML format to file.'),
'default' => false
@ -153,9 +154,9 @@ class TestShell extends Shell {
'help' => __d('cake_console', 'key[=value] Sets a php.ini value.'),
'default' => false
))->addOption('fixture', array(
'help' => __d('cake_console', 'Choose a custom fixture manager.'),
'help' => __d('cake_console', 'Choose a custom fixture manager.')
))->addOption('debug', array(
'help' => __d('cake_console', 'More verbose output.'),
'help' => __d('cake_console', 'More verbose output.')
));
return $parser;

View file

@ -32,15 +32,16 @@ App::uses('CakeTestLoader', 'TestSuite');
class TestsuiteShell extends TestShell {
/**
* get the option parser for the test suite.
* Gets the option parser instance and configures it.
*
* @return void
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->description(array(
__d('cake_console', 'The CakePHP Testsuite allows you to run test cases from the command line'),
__d('cake_console', "<warning>This shell is for backwards-compatibility only</warning>\nuse the test shell instead"),
__d('cake_console', "<warning>This shell is for backwards-compatibility only</warning>\nuse the test shell instead")
));
return $parser;

View file

@ -779,11 +779,13 @@ class UpgradeShell extends AppShell {
}
/**
* get the option parser
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
$subcommandParser = array(
'options' => array(
'plugin' => array(
@ -808,53 +810,45 @@ class UpgradeShell extends AppShell {
)
);
return parent::getOptionParser()
->description(__d('cake_console', "A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" .
"Be sure to have a backup of your application before running these commands."))
->addSubcommand('all', array(
$parser->description(
__d('cake_console', "A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" .
"Be sure to have a backup of your application before running these commands."
))->addSubcommand('all', array(
'help' => __d('cake_console', 'Run all upgrade commands.'),
'parser' => $subcommandParser
))
->addSubcommand('tests', array(
))->addSubcommand('tests', array(
'help' => __d('cake_console', 'Update tests class names to FooTest rather than FooTestCase.'),
'parser' => $subcommandParser
))
->addSubcommand('locations', array(
))->addSubcommand('locations', array(
'help' => __d('cake_console', 'Move files and folders to their new homes.'),
'parser' => $subcommandParser
))
->addSubcommand('i18n', array(
))->addSubcommand('i18n', array(
'help' => __d('cake_console', 'Update the i18n translation method calls.'),
'parser' => $subcommandParser
))
->addSubcommand('helpers', array(
))->addSubcommand('helpers', array(
'help' => __d('cake_console', 'Update calls to helpers.'),
'parser' => $subcommandParser
))
->addSubcommand('basics', array(
))->addSubcommand('basics', array(
'help' => __d('cake_console', 'Update removed basics functions to PHP native functions.'),
'parser' => $subcommandParser
))
->addSubcommand('request', array(
))->addSubcommand('request', array(
'help' => __d('cake_console', 'Update removed request access, and replace with $this->request.'),
'parser' => $subcommandParser
))
->addSubcommand('configure', array(
))->addSubcommand('configure', array(
'help' => __d('cake_console', "Update Configure::read() to Configure::read('debug')"),
'parser' => $subcommandParser
))
->addSubcommand('constants', array(
))->addSubcommand('constants', array(
'help' => __d('cake_console', "Replace Obsolete constants"),
'parser' => $subcommandParser
))
->addSubcommand('components', array(
))->addSubcommand('components', array(
'help' => __d('cake_console', 'Update components to extend Component class.'),
'parser' => $subcommandParser
))
->addSubcommand('exceptions', array(
))->addSubcommand('exceptions', array(
'help' => __d('cake_console', 'Replace use of cakeError with exceptions.'),
'parser' => $subcommandParser
));
return $parser;
}
}

View file

@ -456,6 +456,7 @@ class Shell extends Object {
/**
* Gets the option parser instance and configures it.
*
* By overriding this method you can configure the ConsoleOptionParser before returning it.
*
* @return ConsoleOptionParser