コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: NullCascade/TES3Merge
    // 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);
    }