Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                var globals = new GlobalSettings();

                var parser = new GlobalParser();
                parser.AddGlobalOptions(globals);

                if (parser.Parse(args))
                {
                    if (!globals.NoLogo)
                    {
                        PrintLogo();
                    }

                    // TODO - need to handle positional parameters at the group (global) level!
                    Console.WriteLine("** Inject Snippets **");
                    globals.Dump();
                }
            }
            catch (CommandLineParserException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Unhandled exception in main:");
                Console.WriteLine(ex);
            }

            if (Debugger.IsAttached)
            {
                Console.Write("<press ENTER to continue>");
                Console.ReadLine();
            }
        }