2.x Console: Display error message when unknown option is specified

This commit is contained in:
Koji Tanaka 2017-07-18 00:27:39 +09:00
parent fb42b15ce8
commit 65841081e9

View file

@ -431,6 +431,7 @@ class Shell extends CakeObject {
try {
list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
} catch (ConsoleException $e) {
$this->err(__d('cake_console', '<error>Error:</error> %s', $e->getMessage()));
$this->out($this->OptionParser->help($command));
return false;
}