mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing incorrectly inflected shell names in help.
This commit is contained in:
parent
5f84b4846c
commit
fb756c5aee
2 changed files with 13 additions and 3 deletions
|
@ -124,7 +124,7 @@ class ConsoleOptionParser {
|
|||
* this to false will prevent the addition of `--verbose` & `--quiet` options.
|
||||
*/
|
||||
public function __construct($command = null, $defaultOptions = true) {
|
||||
$this->_command = $command;
|
||||
$this->command($command);
|
||||
|
||||
$this->addOption('help', array(
|
||||
'short' => 'h',
|
||||
|
@ -206,7 +206,7 @@ class ConsoleOptionParser {
|
|||
*/
|
||||
public function command($text = null) {
|
||||
if ($text !== null) {
|
||||
$this->_command = $text;
|
||||
$this->_command = Inflector::underscore($text);
|
||||
return $this;
|
||||
}
|
||||
return $this->_command;
|
||||
|
|
|
@ -496,6 +496,16 @@ TEXT;
|
|||
$this->assertEquals('factory', $parser->command());
|
||||
}
|
||||
|
||||
/**
|
||||
* test that command() inflects the command name.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCommandInflection() {
|
||||
$parser = new ConsoleOptionParser('CommandLine');
|
||||
$this->assertEquals('command_line', $parser->command());
|
||||
}
|
||||
|
||||
/**
|
||||
* test that parse() takes a subcommand argument, and that the subcommand parser
|
||||
* is used.
|
||||
|
|
Loading…
Add table
Reference in a new issue