aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-10-26 15:21:43 +0200
committerTeddy Wing2018-10-26 15:24:11 +0200
commit9bc024a5fc77ac590ff42da6affc44f4af688aff (patch)
treed17434dbcf745673fb04f77bacb2fe3fdaa250ba
parentfe3fc5ad9715a0f07558d1c36dfdbbdd37260ac4 (diff)
downloadDomeKey-9bc024a5fc77ac590ff42da6affc44f4af688aff.tar.bz2
Add license file using `--license` argument
When a license path is passed in with `--license`, call `addLicense:`. Otherwise we run the license validator.
-rw-r--r--DomeKey/main.m14
1 files 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 <sysexits.h>
+
#import <Foundation/Foundation.h>
+
#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];