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