private async Task <(int exitCode, IConsole console)> RunCommand(params string[] args) { var command = new MergeCommand(); var console = new TestConsole(); var exitCode = await command.InvokeAsync(args, console); return(exitCode, console); }
// main entry point to parse commandline options private static async Task Main(string[] args) { var rootCommand = new MergeCommand() { new MultipatchCommand(), new VerifyCommand() }; var version = Assembly.GetExecutingAssembly().GetName().Version; WriteToLogAndConsole($"TES3Merge v{version}."); // Before anything, load the config. LoadConfig(); if (Configuration is null) { WriteToLogAndConsole("Could not load TES3Merge's configuration. Aborting."); ShowCompletionPrompt(); return; } // Get the installation information. CurrentInstallation = Installation.CreateFromContext(); if (CurrentInstallation is null) { WriteToLogAndConsole("Could not find installation directory. Aborting."); ShowCompletionPrompt(); return; } else { WriteToLogAndConsole($"Installation folder: {CurrentInstallation.RootDirectory}"); } await rootCommand.InvokeAsync(args); }