Browse files

Fixed command line parsing using default arguments.

The problem was in using the first cmd line argument which is path to executable. This is correctly used now.
  • Loading branch information...
1 parent 3fa1fde commit aac9cf40de3f1fffee284fb6f05b06d20f533709 @tomaz committed Sep 25, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 GBCli/src/GBCommandLineParser.m
View
3 GBCli/src/GBCommandLineParser.m
@@ -93,8 +93,9 @@ - (void)registerSwitch:(NSString *)longOption {
- (BOOL)parseOptionsUsingDefaultArgumentsWithBlock:(GBCommandLineParseBlock)handler {
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
- NSArray *arguments = [processInfo arguments];
NSString *command = [processInfo processName];
+ NSMutableArray *arguments = [[processInfo arguments] mutableCopy];
+ [arguments removeObjectAtIndex:0];
return [self parseOptionsWithArguments:arguments commandLine:command block:handler];
}

0 comments on commit aac9cf4

Please sign in to comment.