2008-12-21 12:07:45 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2008-12-21 14:19:17 +00:00
|
|
|
#include "SC3Controller.h"
|
2008-12-21 12:07:45 +00:00
|
|
|
|
|
|
|
int main (int argc, const char **argv) {
|
|
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
2008-12-21 14:19:17 +00:00
|
|
|
SC3Controller *controller = [[SC3Controller alloc] init];
|
2008-12-21 12:07:45 +00:00
|
|
|
|
|
|
|
if(argv[1] == NULL) {
|
|
|
|
NSLog(@"Usage: sc3ctrl -x");
|
|
|
|
} else {
|
|
|
|
NSString *arg = [NSString stringWithUTF8String:argv[1]];
|
|
|
|
|
|
|
|
if([arg isEqual:@"-x"]) {
|
2008-12-21 14:19:17 +00:00
|
|
|
[controller interpretContentsOfEnvironmentVariable:(argv[2] == NULL ? "SC3_INTERPRET_TEXT" : argv[2])];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if([arg isEqual:@"-d"]) {
|
|
|
|
if(argc < 3) {
|
|
|
|
NSLog(@"Usage: sc3ctrl -d classname");
|
|
|
|
} else {
|
|
|
|
[controller openHelpFile:[NSString stringWithUTF8String:argv[2]]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if([arg isEqual:@"-j"]) {
|
|
|
|
if(argc < 3) {
|
|
|
|
NSLog(@"Usage: sc3ctrl -j classname");
|
2008-12-21 12:07:45 +00:00
|
|
|
} else {
|
2008-12-21 14:19:17 +00:00
|
|
|
[controller openClassFile:[NSString stringWithUTF8String:argv[2]]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if([arg isEqual:@"-y"]) {
|
|
|
|
if(argc < 3) {
|
|
|
|
NSLog(@"Usage: sc3ctrl -y methodname");
|
|
|
|
} else {
|
|
|
|
[controller openImplementations:[NSString stringWithUTF8String:argv[2]]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if([arg isEqual:@"-Y"]) {
|
|
|
|
if(argc < 3) {
|
|
|
|
NSLog(@"Usage: sc3ctrl -Y methodname");
|
|
|
|
} else {
|
|
|
|
[controller openReferences:[NSString stringWithUTF8String:argv[2]]];
|
2008-12-21 12:07:45 +00:00
|
|
|
}
|
2008-12-21 17:11:01 +00:00
|
|
|
}
|
2008-12-21 12:07:45 +00:00
|
|
|
}
|
2008-12-21 14:19:17 +00:00
|
|
|
|
|
|
|
[controller close];
|
|
|
|
[controller release];
|
2008-12-21 12:07:45 +00:00
|
|
|
[pool drain];
|
|
|
|
return 0;
|
|
|
|
}
|