diff --git a/main.cpp b/main.cpp index 65f5506..411791a 100644 --- a/main.cpp +++ b/main.cpp @@ -40,9 +40,17 @@ int main(int argc, char *argv[]) { QCommandLineOption h({ "b", "background" }, "Does not show the main window, starts in tray."); QCommandLineOption v({ "v", "verbose" }, "Enables QtDebugMsg outputs"); + QCommandLineOption ver({ "ver", "version" }, "Prints KShare version"); parser.addOption(h); parser.addOption(v); + parser.addOption(ver); parser.process(a); + + if (parser.isSet(ver)) { + printf("%s %s\n", a.applicationName().toLocal8Bit().constData(), a.applicationVersion().toLocal8Bit().constData()); + return 0; + } + verbose = parser.isSet(v); MainWindow w;