diff options
| author | Teddy Wing | 2021-03-07 18:01:34 +0100 |
|---|---|---|
| committer | Teddy Wing | 2021-03-07 18:01:34 +0100 |
| commit | 6bdf034c31bb629996ba37241520fb8901228c3a (patch) | |
| tree | b299ca465722ce08c96bfecc8c04c34748359943 | |
| parent | 8d3141717c257eff5af8ee1cdaa7f26328e38f6f (diff) | |
| download | Re-Good-Catalina-Invert-Colours-6bdf034c31bb629996ba37241520fb8901228c3a.tar.bz2 | |
main: Add a version string and command line argument to get the version
| -rw-r--r-- | main.m | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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]; |
