Skip to content
This repository was archived by the owner on Aug 23, 2021. It is now read-only.

Commit 9e2c588

Browse files
committed
Add version option (maybe Ill stop forgetting now)
1 parent c76eeec commit 9e2c588

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,17 @@ int main(int argc, char *argv[]) {
4040

4141
QCommandLineOption h({ "b", "background" }, "Does not show the main window, starts in tray.");
4242
QCommandLineOption v({ "v", "verbose" }, "Enables QtDebugMsg outputs");
43+
QCommandLineOption ver({ "ver", "version" }, "Prints KShare version");
4344
parser.addOption(h);
4445
parser.addOption(v);
46+
parser.addOption(ver);
4547
parser.process(a);
48+
49+
if (parser.isSet(ver)) {
50+
printf("%s %s\n", a.applicationName().toLocal8Bit().constData(), a.applicationVersion().toLocal8Bit().constData());
51+
return 0;
52+
}
53+
4654
verbose = parser.isSet(v);
4755

4856
MainWindow w;

0 commit comments

Comments
 (0)