aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-03-07 18:01:34 +0100
committerTeddy Wing2021-03-07 18:01:34 +0100
commit6bdf034c31bb629996ba37241520fb8901228c3a (patch)
treeb299ca465722ce08c96bfecc8c04c34748359943
parent8d3141717c257eff5af8ee1cdaa7f26328e38f6f (diff)
downloadRe-Good-Catalina-Invert-Colours-6bdf034c31bb629996ba37241520fb8901228c3a.tar.bz2
main: Add a version string and command line argument to get the version
-rw-r--r--main.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.m b/main.m
index 4a01357..84bb3aa 100644
--- a/main.m
+++ b/main.m
@@ -23,11 +23,22 @@
#import "Invert.h"
#import "DDHotKeyCenter.h"
+static const char *VERSION = "0.0.1";
+
static const int E_REGISTER_HOTKEY = 5;
int register_hotkeys();
int main(int argc, const char * argv[]) {
+ if (argc > 1 && (
+ strcmp("-V", argv[1]) == 0
+ || strcmp("--version", argv[1]) == 0
+ )) {
+ printf("%s\n", VERSION);
+
+ return 0;
+ }
+
[NSAutoreleasePool new];
[NSApplication sharedApplication];