Return non-zero on display usage

`Icingacli` should return non-zeno status code when display usage messages
 for example for invalid commands

https://github.com/Icinga/icinga2/issues/6585#issuecomment-418681789

It is good for automation and helps mitigate typing errors
This commit is contained in:
Max Kozlov 2018-09-05 22:16:25 +03:00 committed by GitHub
parent b3e0b5d587
commit a55e32b1a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -146,11 +146,12 @@ class Cli extends ApplicationBootstrap
{
$loader = $this->cliLoader();
$loader->parseParams();
$loader->dispatch();
$result = $loader->dispatch();
Benchmark::measure('All done');
if ($this->showBenchmark) {
Benchmark::dump();
}
if ($result === FALSE) exit(1);
}
protected function dispatchEndless()