From: Gunnar Beutner Date: Mon, 20 Oct 2014 12:13:57 +0000 (+0200) Subject: Improve --help formatting X-Git-Tag: v2.2.0~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ddf5b32931795ef61dfe2699fb7cfbb27fc3f23;p=icinga2 Improve --help formatting refs #7246 --- diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index ea24f66a0..64e17d323 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -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 " << std::endl << "Icinga home page: " << std::endl; return EXIT_SUCCESS; diff --git a/lib/cli/clicommand.cpp b/lib/cli/clicommand.cpp index fb89481b5..3e5bdefad 100644 --- a/lib/cli/clicommand.cpp +++ b/lib/cli/clicommand.cpp @@ -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;