]> granicus.if.org Git - icinga2/commitdiff
Improve --help formatting
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 20 Oct 2014 12:13:57 +0000 (14:13 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 20 Oct 2014 12:13:57 +0000 (14:13 +0200)
refs #7246

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

index ea24f66a082414f4b6067c5371cc61a432e68644..64e17d323ffdad56a35930846b62ea9944a0503c 100644 (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;
index fb89481b52429cee11691928d65db69614f3763f..3e5bdefad251a54f1102e39ba7626ca435cc74c4 100644 (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;