public static int Main(string[] args) { // Parse the command line and if there are any errors, bail. // var commandLine = CommandLine.Parse(args); if (commandLine.Help) { CommandLine.DisplayHelp(); return 0; } if (commandLine.Errors.Any()) { foreach (var error in commandLine.Errors) { Console.WriteLine(error); } return -2; } // Run the program. // try { Console.WriteLine("Processing site: {0}", Path.GetFullPath(commandLine.SitePath)); var program = new Program(); using (var capture = Statistics.Current.Start(StatisticTiming.Overall)) { program.Run(commandLine); } if (commandLine.ReportStatistics) { Statistics.Current.Report(); } } catch (Exception e) { Console.WriteLine("Exception: {0}", e); return -1; } return 0; }