From 221e5c5fc4a96c1aa94188d5fa084ab5d07a457e Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Sat, 6 Jun 2020 20:04:48 +0200 Subject: [PATCH] Improve command line version info and help display to streamline gui and cmd Signed-off-by: Michael Schuster --- src/gui/application.cpp | 8 ++++---- src/libsync/theme.cpp | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index be5c098fe..65539b9b5 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -68,9 +68,9 @@ namespace { static const char optionsC[] = "Options:\n" - " -h --help : show this help screen.\n" - " --version : show version information.\n" - " --logwindow : open a window to show log output.\n" + " --help, -h : show this help screen.\n" + " --version, -v : show version information.\n" + " --logwindow, -l : open a window to show log output.\n" " --logfile : write log output to file .\n" " --logdir : write each sync log output in a new file\n" " in folder .\n" @@ -495,7 +495,7 @@ void Application::parseOptions(const QStringList &options) _debugMode = true; } else if (option == QLatin1String("--background")) { _backgroundMode = true; - } else if (option == QLatin1String("--version")) { + } else if (option == QLatin1String("--version") || option == QLatin1String("-v")) { _versionOnly = true; } else { showHint("Unrecognized option '" + option.toStdString() + "'"); diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 5ad0c4363..6e0e2760f 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -565,7 +565,10 @@ QString Theme::versionSwitchOutput() const stream << "Git revision " << GIT_SHA1 << endl; #endif stream << "Using Qt " << qVersion() << ", built against Qt " << QT_VERSION_STR << endl; - stream << "Using Qt platform plugin '" << QGuiApplication::platformName() << "'" << endl; + + if(!QGuiApplication::platformName().isEmpty()) + stream << "Using Qt platform plugin '" << QGuiApplication::platformName() << "'" << endl; + stream << "Using '" << QSslSocket::sslLibraryVersionString() << "'" << endl; stream << "Running on " << Utility::platformName() << ", " << QSysInfo::currentCpuArchitecture() << endl; return helpText; -- 2.30.2