mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Revert "CLI: Return non-zero on unknown sub commands"
This reverts commit 00bc0b230357bf02c1c9da4ca59c2d359c73a538.
This commit is contained in:
parent
af42e2dfc0
commit
aed88ca477
@ -327,13 +327,8 @@ static int Main()
|
|||||||
po::variables_map vm;
|
po::variables_map vm;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!CLICommand::ParseCommand(argc, argv, visibleDesc, hiddenDesc, positionalDesc,
|
CLICommand::ParseCommand(argc, argv, visibleDesc, hiddenDesc, positionalDesc,
|
||||||
vm, cmdname, command, autocomplete)) {
|
vm, cmdname, command, autocomplete);
|
||||||
|
|
||||||
Log(LogCritical, "icinga-app")
|
|
||||||
<< "Command parsing error. Try '--help'.";
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Log(LogCritical, "icinga-app")
|
Log(LogCritical, "icinga-app")
|
||||||
<< "Error while parsing command-line options: " << ex.what();
|
<< "Error while parsing command-line options: " << ex.what();
|
||||||
|
@ -200,12 +200,9 @@ found_command:
|
|||||||
visibleDesc.add(vdesc);
|
visibleDesc.add(vdesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (autocomplete)
|
if (autocomplete || (tried_command && !command))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (tried_command && !command)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
po::options_description adesc;
|
po::options_description adesc;
|
||||||
adesc.add(visibleDesc);
|
adesc.add(visibleDesc);
|
||||||
adesc.add(hiddenDesc);
|
adesc.add(hiddenDesc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user