Exemple #1
0
        void Execute(string[] args)
        {
            try {
                WriteHeader();

                var options = new PhantomOptions();

                try {
                    options.Parse(args);
                }
                catch (CommandLineException exception) {
                    Console.WriteLine(exception.Message);
                    options.PrintHelp();
                    return;
                }

                if (options.Help)
                {
                    options.PrintHelp();
                    return;
                }

                var runner = BuildRunner.Create();

                if (options.ShowTargets)
                {
                    runner.OutputTargets(options);
                    return;
                }

                PrintSelectedTargets(options);

                runner.Execute(options);
            }
            catch (Exception exception) {
                Environment.ExitCode = 1;
                Console.WriteLine(exception);
            }
        }