Browse Source

Exposed mode to CLI

Pierre-Olivier Latour 11 years ago
parent
commit
0a48f42ccb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Mac/main.m

+ 2 - 1
Mac/main.m

@@ -29,9 +29,10 @@
 
 int main(int argc, const char* argv[]) {
   BOOL success = NO;
+  int mode = (argc == 2 ? MIN(MAX(atoi(argv[1]), 0), 2) : 0);
   @autoreleasepool {
     GCDWebServer* webServer = [[GCDWebServer alloc] init];
-    switch (0) {
+    switch (mode) {
       
       case 0: {
         [webServer addHandlerForBasePath:@"/" localPath:NSHomeDirectory() indexFilename:nil cacheAge:0 allowRangeRequests:YES];