private static int Main(string[] args) { int num; try { RoslynMetricsOptions roslynMetricsOption = new RoslynMetricsOptions(args); if (!string.IsNullOrWhiteSpace(roslynMetricsOption.File) && !string.IsNullOrWhiteSpace(roslynMetricsOption.Output)) { FileInfo fileInfo = new FileInfo(roslynMetricsOption.File); if (fileInfo.Exists) { string lower = fileInfo.Extension.ToLower(); string str = lower; if (lower != null) { if (str == ".sln") { RoslynMetricsExe.BuildReportFromSolution(roslynMetricsOption.File, roslynMetricsOption.Output, roslynMetricsOption.IgnoreGeneratedCode); } else if (str == ".csproj") { RoslynMetricsExe.BuildReportFromStandAloneProject(roslynMetricsOption.File, roslynMetricsOption.Output, false); } } } } num = 0; } catch (FileNotFoundException fileNotFoundException) { Console.Error.Write(fileNotFoundException.Message); num = 4098; } catch (Exception exception) { Console.Error.Write(exception.Message); num = 1; } return(num); }
public RoslynMetricsOptions(IEnumerable <string> args) { this.options = RoslynMetricsOptions.ParseOptions(args); }