Open MVKozlov opened 6 years ago
Can you look into the code and create PR please? :)
Keep in mind that icingacli
is part of Icinga/icingaweb2, so a PR is welcome there as well :)
Sorry, my c++ knowlege does not allow this.
And my php knowlege also too small, but for Icingacli
I can suppose that this will be enought
--- library/Icinga/Application/Cli.php.orig 2018-09-05 10:21:19.597856863 +0300
+++ library/Icinga/Application/Cli.php 2018-09-05 10:20:26.109856269 +0300
@@ -146,11 +146,12 @@
{
$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()
I think this change too small for PR :)
Please create a PR over at icinga/icingaweb2 for review. Even if it would contain a typo fix, it is very easy to review and merge, it saves time.
Needed something simple before digging into the hard issues for 2.11 again.
Unfortunately not fixed, this breaks our sub commands.
icinga2 sdfsdfsdf; echo "Status Code:$?"
icingacli sdfsdfsdf; echo "Status Code:$?"
Expected Behavior
both commands should return non-zeno status code
Current Behavior
Status Code:0
Context
It is good for automation and helps mitigate typing errors