File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 77//
88
99#import < Foundation/Foundation.h>
10+ #import " utils.h"
11+ #import " MOMCompiler.h"
1012#import " MOMPrinter.h"
1113
1214int main (int argc, const char * argv[])
@@ -15,8 +17,18 @@ int main(int argc, const char * argv[])
1517 @autoreleasepool {
1618 if (argc == 2 ) {
1719 NSString *path = [NSString stringWithCString: argv[1 ] encoding: NSUTF8StringEncoding];
20+ MOMCompiler *compiler = [[[MOMCompiler alloc ] init ] autorelease ];
21+ NSString *compiledPath = [compiler compilePath: path];
22+ if (compiledPath == nil ) {
23+ return 2 ;
24+ }
1825 MOMPrinter *printer = [[[MOMPrinter alloc ] init ] autorelease ];
19- [printer printPath: path];
26+ if (![printer printPath: compiledPath]) {
27+ return 2 ;
28+ }
29+ } else {
30+ NSPrintf (@" Usage: %@ path_to_xcdatamodel_file\n " , [[NSProcessInfo processInfo ] processName ]);
31+ return 1 ;
2032 }
2133 }
2234 return 0 ;
You can’t perform that action at this time.
0 commit comments