diff --git a/src/Console/ConsoleOptionParser.php b/src/Console/ConsoleOptionParser.php index 64b91943abd..36e31ec0cff 100644 --- a/src/Console/ConsoleOptionParser.php +++ b/src/Console/ConsoleOptionParser.php @@ -665,7 +665,7 @@ public function subcommands() */ public function parse($argv) { - $command = isset($argv[0]) ? $argv[0] : null; + $command = isset($argv[0]) ? Inflector::underscore($argv[0]) : null; if (isset($this->_subcommands[$command])) { array_shift($argv); } diff --git a/src/Console/Shell.php b/src/Console/Shell.php index 71ba999f2c7..c96210bde71 100644 --- a/src/Console/Shell.php +++ b/src/Console/Shell.php @@ -440,7 +440,7 @@ public function parseDispatchArguments($args) */ public function runCommand($argv, $autoMethod = false, $extra = []) { - $command = isset($argv[0]) ? $argv[0] : null; + $command = isset($argv[0]) ? Inflector::underscore($argv[0]) : null; $this->OptionParser = $this->getOptionParser(); try { list($this->params, $this->args) = $this->OptionParser->parse($argv);