private void SetDebug(CmdOptions cmds) { IoC.Bind(new DebugConfig()); IoC.Debug.DisableGameCache = cmds.DisableGameCache; IoC.Debug.SingleThread = cmds.SingleThread; if (!String.IsNullOrEmpty(cmds.Version) && Version.TryParse(cmds.Version, out var debugVersion)) { IoC.Bind(debugVersion); } }
protected override void OnStartup(StartupEventArgs e) { var cmds = new CmdOptions(); var parser = new Parser(with => with.HelpWriter = Console.Error); parser.ParseArguments <CmdOptions>(e.Args) .WithParsed(o => cmds = o) .WithNotParsed(errs => Console.WriteLine("Unable to parse command line: {0}", String.Join(" ", e.Args))); SetDebug(cmds); base.OnStartup(e); }