static void Main(string[] args) { #if !ANSI if (!IsAnsiCompilant()) { AnsiSequencer.Enable(); AnsiSequencer.EnableModule <SGRModule>(); } #else AnsiSequencer.Enable(); AnsiSequencer.EnableModule <SGRModule>(); #endif PrintHeader(); var unparsed = new List <string>(); var opts = new OptionSet(); var argsObj = new ProgramArguments(); opts.Add("<>", arg => { var m = OptionSet.ValueOptionRegex.Match(arg); if (m.Success) { PrintInvalid(m.Groups["name"].Value); Environment.Exit(1); } else if (File.Exists(arg)) { argsObj.RgssArchive = arg; } else { unparsed.Add(arg); } } ); opts.Add("?|help", "Displays this help message", arg => { PrintHelp(opts); Environment.Exit(0); }); opts.Add("d|dump", $"Only Dumps Archive Information\n(Default: {argsObj.InfoDump})", arg => argsObj.InfoDump = true); opts.Add("o|output=", $"Output Directory, Relative to RGSS Archive.\n(Default: {argsObj.OutputDir})", arg => argsObj.OutputDir = arg); opts.Add("p|proj", $"Creates Project File.\n(Default: {argsObj.CreateProjectFile})", arg => argsObj.CreateProjectFile = true); opts.Add("q|quiet", $"Supresses Output. \n(Default: {argsObj.SupressOutput})", arg => argsObj.SupressOutput = true); opts.Add("r|register", "Registers Context Menu Handler", arg => argsObj.RegisterContext = true); opts.Add("u|unregister", "Unregisters Context Menu Handler", arg => argsObj.UnregisterContext = true); if (args.Length == 0) { PrintHelp(opts); Environment.Exit(1); } var ext = opts.Parse(args); SubMain(argsObj); }
static partial void SubMain(ProgramArguments args);