Skip to content

Commit

Permalink
add basic command line call. Parsing not implemnted yet
Browse files Browse the repository at this point in the history
  • Loading branch information
cescofry committed Jun 27, 2013
1 parent 37a5e1d commit bde7a37
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Strings/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,30 @@ int main(int argc, const char * argv[])

@autoreleasepool {

NSString *arg = (argc == 2)? [NSString stringWithUTF8String:argv[1]] : @"--help";

if ([arg isEqualToString:@"--help"]) {
printf("Strings is a tool to convert iOS to Android translations file and vice versa.\nPlease use strings <ROOT URL> to start\n");
return 0;
}

// insert code here...
NSLog(@"Starting Strings:");
NSString *urlString = [NSString stringWithUTF8String:argv[0]];
NSLog(@"Scanning %@", urlString);

NSURL *url = [NSURL URLWithString:arg];
if (!url){
printf("The directory provided is not valid. Exiting\n");
return 0;
}

printf("Scanning %s\n", url.absoluteString.UTF8String);



ZFStringScanner *scanner = [[ZFStringScanner alloc] init];
[scanner scanStringsAtURL:[NSURL URLWithString:urlString]];
[scanner startScanAtURL:url];

NSLog(@"Done, exiting");
printf("Nothing Done. Exiting\n");

}
return 0;
Expand Down

0 comments on commit bde7a37

Please sign in to comment.