private static void HandleInput(string[] args) { for (int i = 0; i < args.Length; i++) { switch (args[i]) { case "-c": case "--config": try { AppHelpers.GetConfigInput(args[i + 1]); } catch { } break; case "--input-splitter": string?videoInputPath = null; string?videoOutputDirectoryInput = null; try { videoInputPath = args[i + 1]; videoOutputDirectoryInput = args[i + 2]; } catch { System.Console.WriteLine("--input-splitter {video-path} {output-dir}"); } InputSplitter.Run(videoInputPath, videoOutputDirectoryInput); break; case "--output-combiner": string?oldVideo = null; string?newVideo = null; try { oldVideo = args[i + 1]; newVideo = args[i + 2]; } catch { System.Console.WriteLine("--output-combiner {old-video} {new-video}"); } OutputCombiner.Run(oldVideo, newVideo); break; default: break; } } }
public static void GetConfigInput(string?configPath = null) { while (true) { var input = AppHelpers.GetFileInput("Input a config file path: ", configPath); if (input == null) { continue; } try { AppConfig.AppConfigManager.SetConfig(input); break; } catch { } } }