Add version option (maybe Ill stop forgetting now)

This commit is contained in:
ArsenArsen 2017-05-13 19:31:55 +02:00
parent c76eeec89b
commit 9e2c588c9e

View File

@ -40,9 +40,17 @@ int main(int argc, char *argv[]) {
QCommandLineOption h({ "b", "background" }, "Does not show the main window, starts in tray."); QCommandLineOption h({ "b", "background" }, "Does not show the main window, starts in tray.");
QCommandLineOption v({ "v", "verbose" }, "Enables QtDebugMsg outputs"); QCommandLineOption v({ "v", "verbose" }, "Enables QtDebugMsg outputs");
QCommandLineOption ver({ "ver", "version" }, "Prints KShare version");
parser.addOption(h); parser.addOption(h);
parser.addOption(v); parser.addOption(v);
parser.addOption(ver);
parser.process(a); 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); verbose = parser.isSet(v);
MainWindow w; MainWindow w;