Merge pull request #2061 from nextcloud/enh/version-display-cmd

Improve command line version info and help display (gui & cmd)
This commit is contained in:
Michael Schuster 2020-06-07 14:38:48 +02:00 committed by GitHub
commit 3ce88bb62c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -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 <filename> : write log output to file <filename>.\n"
" --logdir <name> : write each sync log output in a new file\n"
" in folder <name>.\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() + "'");

View File

@ -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;