Exemplo n.º 1
0
        private static Opt Parse(string[] args)
        {
            if (args.Length >= 1)
            {
                AttachConsole(-1);
                switch (args[0])
                {
                case "--switch":
                    Mode.Config config = Handler.ConfigHandler.lazyLoadedConfig();
                    try
                    {
                        config.listenerType = args.Length >= 2 ? int.Parse(args[1]) : -1;
                    }
                    catch (FormatException)
                    {
                        Console.Write("Expecting a number yet got ");
                        ColorWrite(args[1], ConsoleColor.Red, true);
                        System.Environment.Exit(1);
                    }
                    return(new Opt(config));

                default:
                    Console.Write("Unkown option ");
                    ColorWrite(args[0], ConsoleColor.Red, true);
                    System.Environment.Exit(1);
                    break;
                }
            }
            return(null);
        }
Exemplo n.º 2
0
 public Opt(Mode.Config config)
 {
     this.config = config;
 }