Improve --help formatting

refs #7246
This commit is contained in:
Gunnar Beutner 2014-10-20 14:13:57 +02:00
parent 26b9c5a81b
commit 5ddf5b3293
2 changed files with 7 additions and 5 deletions

View File

@ -285,6 +285,8 @@ int Main(void)
std::cout << std::endl << std::endl
<< command->GetDescription();
}
std::cout << "\n";
}
if (vm.count("version")) {
@ -308,13 +310,10 @@ int Main(void)
}
if (!command || vm.count("help")) {
if (!command) {
std::cout << std::endl;
if (!command)
CLICommand::ShowCommands(argc, argv, NULL);
}
std::cout << std::endl
<< visibleDesc << std::endl
std::cout << visibleDesc << std::endl
<< "Report bugs at <https://dev.icinga.org/>" << std::endl
<< "Icinga home page: <http://www.icinga.org/>" << std::endl;
return EXIT_SUCCESS;

View File

@ -289,6 +289,9 @@ void CLICommand::ShowCommands(int argc, char **argv, po::options_description *vi
std::cout << " * " << boost::algorithm::join(vname, " ") << " (" << kv.second->GetShortDescription() << ")" << std::endl;
}
if (!autocomplete)
std::cout << std::endl;
if (command && autocomplete) {
String aname, prefix, pword;
const po::option_description *odesc;