-
Notifications
You must be signed in to change notification settings - Fork 29
/
main.m
47 lines (38 loc) · 805 Bytes
/
main.m
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
36
37
38
39
40
41
42
43
44
45
46
47
/*
main.m
This file is in the public domain.
*/
#import <Cocoa/Cocoa.h>
#ifdef OTX_CLI
#import "CLIController.h"
#else
#import <AppKit/NSApplication.h>
#endif
BOOL gCancel = NO;
int main(
int argc,
char* argv[])
{
if (OS_IS_PRE_TIGER)
{
fprintf(stderr, "otx requires Mac OS X 10.4 or higher.\n");
return -1;
}
int result = 1;
#ifdef OTX_CLI
@autoreleasepool {
CLIController* controller =
[[[CLIController alloc] initWithArgs: argv count: argc] autorelease];
if (controller)
{
[controller processFile];
result = noErr;
}
else
result = -1;
}
#else
result = NSApplicationMain(argc, (const char**)argv);
#endif
return result;
}