From 8367719d016312c5538216f033fd2f7ec89988f8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 26 Oct 2018 04:30:35 +0200 Subject: main: Print version string when the `version` command line arg is passed Store the version string in code, as otherwise the only way to get it appears to be from Info.plist, and we don't have one of those in this application. --- DomeKey/main.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DomeKey/main.m b/DomeKey/main.m index 5daf4b8..8cf2c10 100644 --- a/DomeKey/main.m +++ b/DomeKey/main.m @@ -13,6 +13,8 @@ #import "Mappings.h" #import "dome_key_map.h" +static const char *VERSION = "1.0"; + int main(int argc, const char * argv[]) { Config *config = config_get(); @@ -41,6 +43,8 @@ int main(int argc, const char * argv[]) { [NSApp run]; } + } else if (config->args.version) { + printf("DomeKey version %s\n", VERSION); } config_free(config); -- cgit v1.2.3