Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }