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:
parent
b3e0b5d587
commit
a55e32b1a1
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue