]> granicus.if.org Git - icinga2/commitdiff
Revert "CLI: Return non-zero on unknown sub commands" 7180/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 10 May 2019 13:16:05 +0000 (15:16 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 10 May 2019 13:16:05 +0000 (15:16 +0200)
This reverts commit 00bc0b230357bf02c1c9da4ca59c2d359c73a538.

icinga-app/icinga.cpp
lib/cli/clicommand.cpp

index ca103f3146a303058b1d0595527ada76bb4dc904..5d3e3165e4091b46d84317143b7cb3b65d03e59b 100644 (file)
@@ -327,13 +327,8 @@ static int Main()
        po::variables_map vm;
 
        try {
-               if (!CLICommand::ParseCommand(argc, argv, visibleDesc, hiddenDesc, positionalDesc,
-                       vm, cmdname, command, autocomplete)) {
-
-                       Log(LogCritical, "icinga-app")
-                               << "Command parsing error. Try '--help'.";
-                       return EXIT_FAILURE;
-               }
+               CLICommand::ParseCommand(argc, argv, visibleDesc, hiddenDesc, positionalDesc,
+                       vm, cmdname, command, autocomplete);
        } catch (const std::exception& ex) {
                Log(LogCritical, "icinga-app")
                        << "Error while parsing command-line options: " << ex.what();
index 7e93c5c61549fbb6923afec49686b396a1bc2aba..878beac77a2b629f041edab8626e6601c8e00966 100644 (file)
@@ -200,12 +200,9 @@ found_command:
                visibleDesc.add(vdesc);
        }
 
-       if (autocomplete)
+       if (autocomplete || (tried_command && !command))
                return true;
 
-       if (tried_command && !command)
-               return false;
-
        po::options_description adesc;
        adesc.add(visibleDesc);
        adesc.add(hiddenDesc);