Changing how arguments are shown in help output.

This commit is contained in:
mark_story 2010-10-13 21:12:33 -04:00
parent 3e1554f5bb
commit 037bc6cb2f
2 changed files with 4 additions and 3 deletions

View file

@ -90,6 +90,7 @@ class ConsoleInputArgument {
if (!empty($this->_choices)) {
$name = implode('|', $this->_choices);
}
$name = '<' . $name . '>';
if (!$this->isRequired()) {
$name = '[' . $name . ']';
}

View file

@ -407,7 +407,7 @@ TEXT;
$result = $parser->help();
$expected = <<<TEXT
<info>Usage:</info>
cake mycommand [-h] [--test] model [other_longer]
cake mycommand [-h] [--test] <model> [<other_longer>]
<info>Options:</info>
@ -455,7 +455,7 @@ TEXT;
$result = $parser->help();
$expected = <<<TEXT
<info>Usage:</info>
cake mycommand [-h] [--test one|two] aco|aro [other_longer]
cake mycommand [-h] [--test one|two] <aco|aro> [<other_longer>]
<info>Options:</info>
@ -488,7 +488,7 @@ TEXT;
Description text
<info>Usage:</info>
cake mycommand [-h] [--test] model
cake mycommand [-h] [--test] <model>
<info>Options:</info>