diff options
Diffstat (limited to 'Orchestrator')
| -rw-r--r-- | Orchestrator/Program.cs | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/Orchestrator/Program.cs b/Orchestrator/Program.cs index a59127b..213f5ee 100644 --- a/Orchestrator/Program.cs +++ b/Orchestrator/Program.cs @@ -13,32 +13,38 @@ class Program { with.CaseInsensitiveEnumValues = true; }); - + p.ParseArguments<Options>(args).WithParsed(Main); } - + private static void Main(Options options) { string compiledFile = Path.ChangeExtension(options.InputFile, "asm"); string assembledFile = Path.ChangeExtension(options.InputFile, "q1"); - - Q1.Compiler.Program.Main(new CompilerOptions - { - CommentCompilationMode = options.CommentCompilationMode, - InputFile = options.InputFile, - OutputFile = compiledFile - }); - - Q1.Assembler.Program.Main(new AssemblerOptions - { - InputFile = compiledFile, - OutputFile = assembledFile - }); - - Q1.Emulator.Program.Main(new EmulatorOptions - { - InputFile = assembledFile, - }); + + if (!options.NoCompile) + Q1.Compiler.Program.Main( + new CompilerOptions + { + CommentCompilationMode = options.CommentCompilationMode, + InputFile = options.InputFile, + OutputFile = compiledFile + }); + + if (!options.NoAssemble) + Q1.Assembler.Program.Main( + new AssemblerOptions + { + InputFile = compiledFile, + OutputFile = assembledFile + }); + + if (!options.NoEmulate) + Q1.Emulator.Program.Main( + new EmulatorOptions + { + InputFile = assembledFile, + }); } } @@ -46,7 +52,19 @@ class Options { [Option('i', "input", Required = true, HelpText = "Input file to process.")] public string InputFile { get; set; } - - [Option('c', "comment-compilation", Required = false, HelpText = "Comments to preserve in the compiled result")] - public CommentCompilationMode CommentCompilationMode { get; set; } = CommentCompilationMode.UserDefined; + + [Option( + 'c', "comment-compilation", Required = false, + HelpText = "Comments to preserve in the compiled result")] + public CommentCompilationMode CommentCompilationMode { get; set; } = + CommentCompilationMode.UserDefined; + + [Option("no-compile", HelpText = "Skip compilation")] + public bool NoCompile { get; set; } = false; + + [Option("no-assemble", HelpText = "Skip assembling")] + public bool NoAssemble { get; set; } = false; + + [Option("no-emulate", HelpText = "Skip emulation")] + public bool NoEmulate { get; set; } = false; }
\ No newline at end of file |
