Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 35 lines (30 sloc) 0.951 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#import <Cocoa/Cocoa.h>
#import "BirthdaySyncer.h"

int main(int argc, char *argv[])
{
NSLog(@"BirthdaySync startup");

NSString *clientId = 0;
NSArray *entityNames = 0;

for (int i = 0; i < argc; i++) {
NSString *arg = [NSString stringWithCString:argv[i]];
if ([arg isEqualToString:@"--sync"]) {
clientId = [NSString stringWithCString:argv[i+1]];
}
else if ([arg isEqualToString:@"--entitynames"]) {
NSString *entities = [NSString stringWithCString:argv[i+1]];
entityNames = [entities componentsSeparatedByString:@","];
}
}

if (clientId && entityNames) {
NSLog(@"Invoked in sync tool mode");
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BirthdaySyncer *bs = [[BirthdaySyncer alloc] initWithClient:clientId
entityNames:entityNames];
[bs runSynchronousSync];

[pool release];
}
else {
NSLog(@"Invoked in GUI mode");
return NSApplicationMain(argc, (const char **) argv);
}
}
Something went wrong with that request. Please try again.