private static void Main(string[] args) { if (args.Length == 0 || args[0] == "-help" || args[0] == "/?") { Console.WriteLine(ResubOptions.GetHelp()); return; } var options = new ResubOptions(args); if (!options.IsValid) { Console.WriteLine(ResubOptions.GetHelp()); return; } var resub = new Resub(options); try { resub.ReadjustSubtitles(); } catch (Exception exception) { Console.WriteLine($"Error adjusting: {exception.GetType().Name} ({exception.Message})"); } }
/// <exception cref="ArgumentException">Invalid Resub options.</exception> public Resub(ResubOptions options) { _options = options; if (options == null || !options.IsValid) { throw new ArgumentException("Resub options must be valid."); } }