|
11 | 11 |
|
12 | 12 | if __name__ == '__main__': |
13 | 13 | parser = argparse.ArgumentParser() |
14 | | - parser.add_argument('file', help="ASM File", type=argparse.FileType('r')) |
| 14 | + parser.add_argument('file', help="C File", type=argparse.FileType('r')) |
15 | 15 | parser.add_argument('--world-dir', help="World Directory") |
16 | 16 | parser.add_argument('--namespace', help="Function namespace", default='c_generated') |
17 | 17 | parser.add_argument('--rem-existing', help="Remove existing functions in namespace", |
18 | 18 | action='store_true') |
19 | 19 | parser.add_argument('--debug', action='store_true', help="Enable debug output") |
20 | 20 | parser.add_argument('--stack', help="Stack size", type=int, default=8) |
21 | 21 | parser.add_argument('--arg', help="ASM file arguments", action='append') |
22 | | - parser.add_argument('--jump', help='Output subroutine jump instruction') |
23 | 22 | parser.add_argument('--place-location', default="~1,~,~1", |
24 | 23 | help="Location to place command blocks") |
25 | 24 | parser.add_argument('--enable-sync', help="Enable SYNC opcode", action='store_true') |
|
69 | 68 | print ('/' + setup) |
70 | 69 | print('== Cleanup command ==') |
71 | 70 | print('/' + cleanup) |
72 | | - |
73 | | - if args.jump: |
74 | | - print('== Jump to %s command ==' % args.jump) |
75 | | - print('/' + assembler.get_sub_jump_command(args.jump).resolve(session.scope)) |
| 71 | + if 'main' in assembler.subroutines: |
| 72 | + print('== Run main() ==') |
| 73 | + print('/' + assembler.get_sub_jump_command('main').resolve(session.scope)) |
| 74 | + else: |
| 75 | + print('Cannot output jump: No main() function') |
0 commit comments