From 9e2c588c9e93ce4938f5b62f7ea90876bc33a2d1 Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Sat, 13 May 2017 19:31:55 +0200 Subject: [PATCH] Add version option (maybe Ill stop forgetting now) --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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;