]> granicus.if.org Git - icinga2/commitdiff
Update output for `--version` 6506/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 7 Aug 2018 16:44:08 +0000 (18:44 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 7 Aug 2018 16:46:18 +0000 (18:46 +0200)
This moves the system and build information before
the application paths which are normally not that important.

lib/base/application.cpp
lib/cli/troubleshootcommand.cpp

index 0e6b018f22b872de451ecbc8910bc77db7187705..bc8ec1bd45eb5ce9d522c02fa2aafbbf0a7f6195 100644 (file)
@@ -538,27 +538,35 @@ String Application::GetExePath(const String& argv0)
  */
 void Application::DisplayInfoMessage(std::ostream& os, bool skipVersion)
 {
-       os << "Application information:" << "\n";
-
+       /* icinga-app prints its own version information, stack traces need it here. */
        if (!skipVersion)
-               os << "  Application version: " << GetAppVersion() << "\n";
+               os << "  Application version: " << GetAppVersion() << "\n\n";
+
+       os << "System information:\n"
+               << "  Platform: " << Utility::GetPlatformName() << "\n"
+               << "  Platform version: " << Utility::GetPlatformVersion() << "\n"
+               << "  Kernel: " << Utility::GetPlatformKernel() << "\n"
+               << "  Kernel version: " << Utility::GetPlatformKernelVersion() << "\n"
+               << "  Architecture: " << Utility::GetPlatformArchitecture() << "\n";
+
+       os << "\nBuild information:\n"
+               << "  Compiler: " << ScriptGlobal::Get("BuildCompilerName") << " " << ScriptGlobal::Get("BuildCompilerVersion") << "\n"
+               << "  Build host: " << ScriptGlobal::Get("BuildHostName") << "\n";
 
-       os
-               << "\n"
+       os << "\nApplication information:\n"
+               << "\nGeneral paths:\n"
                << "  Config directory: " << GetConst("ConfigDir") << "\n"
                << "  Data directory: " << GetConst("DataDir") << "\n"
                << "  Log directory: " << GetConst("LogDir") << "\n"
                << "  Cache directory: " << GetConst("CacheDir") << "\n"
                << "  Spool directory: " << GetConst("SpoolDir") << "\n"
                << "  Run directory: " << GetConst("InitRunDir") << "\n"
-               << "\n"
-               << "Older paths (deprecated):" << "\n"
+               << "\nOld paths (deprecated):\n"
                << "  Installation root: " << GetConst("PrefixDir") << "\n"
                << "  Sysconf directory: " << GetConst("SysconfDir") << "\n"
                << "  Run directory (base): " << GetConst("RunDir") << "\n"
                << "  Local state directory: " << GetConst("LocalStateDir") << "\n"
-               << "\n"
-               << "Internally used paths:" << "\n"
+               << "\nInternal paths:\n"
                << "  Package data directory: " << GetConst("PkgDataDir") << "\n"
                << "  State path: " << GetConst("StatePath") << "\n"
                << "  Modified attributes path: " << GetConst("ModAttrPath") << "\n"
@@ -566,18 +574,6 @@ void Application::DisplayInfoMessage(std::ostream& os, bool skipVersion)
                << "  Vars path: " << GetConst("VarsPath") << "\n"
                << "  PID path: " << GetConst("PidPath") << "\n";
 
-       os << "\n"
-               << "System information:" << "\n"
-               << "  Platform: " << Utility::GetPlatformName() << "\n"
-               << "  Platform version: " << Utility::GetPlatformVersion() << "\n"
-               << "  Kernel: " << Utility::GetPlatformKernel() << "\n"
-               << "  Kernel version: " << Utility::GetPlatformKernelVersion() << "\n"
-               << "  Architecture: " << Utility::GetPlatformArchitecture() << "\n";
-
-       os << "\n"
-               << "Build information:" << "\n"
-               << "  Compiler: " << ScriptGlobal::Get("BuildCompilerName") << " " << ScriptGlobal::Get("BuildCompilerVersion") << "\n"
-               << "  Build host: " << ScriptGlobal::Get("BuildHostName") << "\n";
 }
 
 /**
index 6c72e1426b6f417a5e136642baad828d732c6606..2770b5588e0d2ccb217d51897ea7d3226180ec70 100644 (file)
@@ -155,13 +155,13 @@ bool TroubleshootCommand::GeneralInfo(InfoLog& log, const boost::program_options
                << "\tCache directory: " << Application::GetConst("CacheDir") << "\n"
                << "\tRun directory: " << Application::GetConst("InitRunDir") << "\n"
                << "\t\n"
-               << "Older paths (deprecated):" << "\n"
+               << "Old paths (deprecated):\n"
                << "\tInstallation root: " << Application::GetConst("PrefixDir") << '\n'
                << "\tSysconf directory: " << Application::GetConst("SysconfDir") << '\n'
                << "\tRun directory: " << Application::GetConst("RunDir") << '\n'
                << "\tLocal state directory: " << Application::GetConst("LocalStateDir") << '\n'
                << "\t\n"
-               << "Internally used paths:" << "\n"
+               << "Internal paths:\n"
                << "\tPackage data directory: " << Application::GetConst("PkgDataDir") << '\n'
                << "\tState path: " << Application::GetConst("StatePath") << '\n'
                << "\tObjects path: " << Application::GetConst("ObjectsPath") << '\n'