Exemplo n.º 1
0
        private static void Run(CLIOptions options)
        {
            if (!ValidateOptions(options))
            {
                Environment.ExitCode = -1;
                return;
            }

            Patcher patcher = new Patcher(options);

            patcher.Run();
        }
Exemplo n.º 2
0
        private static bool ValidateOptions(CLIOptions options)
        {
            if (!File.Exists(options.SourceFile))
            {
                Console.Error.WriteLine($"Source file not found: {options.SourceFile}");
                return(false);
            }

            foreach (string patchPath in options.PatchFiles)
            {
                if (!File.Exists(patchPath))
                {
                    Console.Error.WriteLine($"Patch file not found: {options.PatchFiles}");
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
 public Patcher(CLIOptions options)
 {
     this.options = options;
 }