From 9bc024a5fc77ac590ff42da6affc44f4af688aff Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 26 Oct 2018 15:21:43 +0200 Subject: Add license file using `--license` argument When a license path is passed in with `--license`, call `addLicense:`. Otherwise we run the license validator. --- DomeKey/main.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/DomeKey/main.m b/DomeKey/main.m index 8cf2c10..e9f6160 100644 --- a/DomeKey/main.m +++ b/DomeKey/main.m @@ -6,7 +6,10 @@ // Copyright © 2018 tw. All rights reserved. // +#include + #import + #import "DKApplication.h" #import "AppDelegate.h" #import "LicenseHandler.h" @@ -25,8 +28,15 @@ int main(int argc, const char * argv[]) { config = c_parse_args(argv, argc, config); - [LicenseHandler addLicense:@"dome-key-license.plist"]; - // [LicenseHandler check]; + if (config->args.license) { + [LicenseHandler addLicense:[NSString + stringWithCString:config->args.license + encoding:NSUTF8StringEncoding]]; + + return EX_OK; + } else { + [LicenseHandler check]; + } if (config->args.reload) { return [Mappings dispatchReload]; -- cgit v1.2.3