예제 #1
0
파일: CLI.cs 프로젝트: limenote135/CppSharp
        static void Main(string[] args)
        {
            List <string> errorMessages = new List <string>();
            bool          helpShown     = false;

            try
            {
                if (!ParseCommandLineArgs(args, errorMessages, ref helpShown))
                {
                    PrintErrorMessages(errorMessages);

                    // Don't need to show the help since if ParseCommandLineArgs returns false the help has already been shown
                    return;
                }

                Generator gen = new Generator(options);

                bool validOptions = gen.ValidateOptions(errorMessages);

                PrintErrorMessages(errorMessages);

                if (validOptions)
                {
                    gen.Run();
                }
            }
            catch (Exception ex)
            {
                PrintErrorMessages(errorMessages);
                Console.Error.WriteLine(ex.Message);
            }
        }
예제 #2
0
파일: CLI.cs 프로젝트: walkthetalk/CppSharp
        static void Main(string[] args)
        {
            List <string> errorMessages = new List <string>();
            bool          helpShown     = false;

            if (!ParseCommandLineArgs(args, errorMessages, ref helpShown))
            {
                PrintErrorMessages(errorMessages);

                // Don't need to show the help since if ParseCommandLineArgs returns false the help has already been shown
                return;
            }

            Generator gen = new Generator(options);

            bool validOptions = gen.ValidateOptions(errorMessages);

            PrintErrorMessages(errorMessages);

            if (errorMessages.Any() || !validOptions)
            {
                Environment.Exit(1);
            }

            gen.Run();
        }