|
|
@@ -191,21 +191,28 @@ txt;
|
|
|
{
|
|
|
$parser = new ConsoleOptionParser('mycommand', false);
|
|
|
$parser->addOption('test', ['help' => 'A test option.'])
|
|
|
- ->addOption('connection', [
|
|
|
- 'short' => 'c', 'help' => 'The connection to use.', 'default' => 'default',
|
|
|
- ]);
|
|
|
+ ->addOption('number', [
|
|
|
+ 'help' => 'The number',
|
|
|
+ 'default' => 2,
|
|
|
+ ])
|
|
|
+ ->addOption('connection', [
|
|
|
+ 'short' => 'c',
|
|
|
+ 'help' => 'The connection to use.',
|
|
|
+ 'default' => 'default',
|
|
|
+ ]);
|
|
|
|
|
|
$formatter = new HelpFormatter($parser);
|
|
|
$result = $formatter->text();
|
|
|
$expected = <<<txt
|
|
|
<info>Usage:</info>
|
|
|
-cake mycommand [-c default] [-h] [--test]
|
|
|
+cake mycommand [-c default] [-h] [--number 2] [--test]
|
|
|
|
|
|
<info>Options:</info>
|
|
|
|
|
|
--connection, -c The connection to use. <comment>(default:
|
|
|
default)</comment>
|
|
|
--help, -h Display this help.
|
|
|
+--number The number <comment>(default: 2)</comment>
|
|
|
--test A test option.
|
|
|
|
|
|
txt;
|