diff --git a/aheui/option.py b/aheui/option.py index ed214e5..676dec0 100644 --- a/aheui/option.py +++ b/aheui/option.py @@ -14,13 +14,13 @@ \t1: Quickly resolve deadcode by rough stacksize emulation and merge constant operations. \t2: Perfectly resolve deadcode by stacksize emulation, reserialize code chunks and merge constant operations. """) -parser.add_argument('--source', '-S', default='auto', choices='auto,bytecode,asm,asm+comment,text', description='Set source filetype.', full_description="""\t- `auto`: Guess the source type. `bytecode` if `.aheuic` or `End of bytecode` pattern in source. `asm` is `.aheuis`. `text` if `.aheui`. `text` is default. +parser.add_argument('--source', '-S', default='auto', choices='auto,bytecode,asm,text', description='Set source filetype.', full_description="""\t- `auto`: Guess the source type. `bytecode` if `.aheuic` or `End of bytecode` pattern in source. `asm` is `.aheuis`. `text` if `.aheui`. `text` is default. \t- `bytecode`: Aheui bytecode. (Bytecode representation of `ahsembly`. \t- `asm`: See `ahsembly`. \t- `asm+comment`: Same as `asm` with comments. \t- usage: `--source=asm`, `-Sbytecode` or `-S text` """) -parser.add_argument('--target', '-T', default='run', choices='run,bytecode,asm', description='Set target filetype.', full_description="""\t- `run`: Run given code. +parser.add_argument('--target', '-T', default='run', choices='run,bytecode,asm,asm+comment', description='Set target filetype.', full_description="""\t- `run`: Run given code. \t- `bytecode`: Aheui bytecode. (Bytecode representation of `ahsembly`. \t- `asm`: See `ahsembly`. \t- usage: `--target=asm`, `-Tbytecode` or `-T run` @@ -131,10 +131,11 @@ def open_r(filename): output += '.aheuic' elif target in ['asm', 'asm+comment']: output = filename - if output.endswith('.aheui'): - output += 's' - else: - output += '.aheuis' + if output != '-': + if output.endswith('.aheui'): + output += 's' + else: + output += '.aheuis' comment_aheuis = target == 'asm+comment' elif target == 'run': output = '-'