mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
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 = $this->cliLoader();
|
||||||
$loader->parseParams();
|
$loader->parseParams();
|
||||||
$loader->dispatch();
|
$result = $loader->dispatch();
|
||||||
Benchmark::measure('All done');
|
Benchmark::measure('All done');
|
||||||
if ($this->showBenchmark) {
|
if ($this->showBenchmark) {
|
||||||
Benchmark::dump();
|
Benchmark::dump();
|
||||||
}
|
}
|
||||||
|
if ($result === FALSE) exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function dispatchEndless()
|
protected function dispatchEndless()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user