示例#1
0
 public void Sensible_Defaults()
 {
     args.Parse(new string[0]);
     args.File.ShouldEqual("build.boo");
     args.Help.ShouldEqual(false);
     args.TargetNames.Single().ShouldEqual("default");
 }
示例#2
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);
            }
        }
示例#3
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);
            }
        }