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 { try {
list($this->params, $this->args) = $this->OptionParser->parse($argv, $command); list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
} catch (ConsoleException $e) { } catch (ConsoleException $e) {
$this->err(__d('cake_console', '<error>Error:</error> %s', $e->getMessage()));
$this->out($this->OptionParser->help($command)); $this->out($this->OptionParser->help($command));
return false; return false;
} }