diff --git a/main.cpp b/main.cpp index 6cd98d3..f7b4916 100644 --- a/main.cpp +++ b/main.cpp @@ -112,14 +112,24 @@ int main(int argc, char *argv[]) { QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions.")); parser.addOption(dryRunOption); + QCommandLineOption extendedVersionOption(QStringList() << "V" << "extended-version", + QCoreApplication::translate("main", "Show extended version (including last git commit).")); + parser.addOption(extendedVersionOption); + // Process the actual command line arguments given by the user parser.process(a); QString plugInDir = parser.value(pluginDirectoryOption); QString plugInName = parser.value(pluginNameOption); QString workingDir = parser.value(workingDirectoryOption); - bool dryRun = parser.isSet(dryRunOption); + bool const dryRun = parser.isSet(dryRunOption); + bool const showExtendedVersion = parser.isSet(extendedVersionOption); QString const rtPath = QCoreApplication::applicationDirPath(); + if (showExtendedVersion) { + printf(APP_EXTENDED_VERSION"\n"); + return 0; + } + if (!QDir(plugInDir).exists()) { qCritical() << plugInDir << "does not exists, but has to contain dc-library";