diff --git a/src/CodeCoverageSummary/CommandLineOptions.cs b/src/CodeCoverageSummary/CommandLineOptions.cs index 3301391..156d73d 100644 --- a/src/CodeCoverageSummary/CommandLineOptions.cs +++ b/src/CodeCoverageSummary/CommandLineOptions.cs @@ -1,4 +1,5 @@ using CommandLine; +using System; namespace CodeCoverageSummary { @@ -7,14 +8,18 @@ namespace CodeCoverageSummary [Value(index: 0, Required = true, HelpText = "Code coverage file to analyse.")] public string Filename { get; set; } - [Option(longName: "badge", Required = false, HelpText = "Include a badge reporting the Line Rate coverage in the output using shields.io - true or false.", Default = false)] - public bool Badge { get; set; } + [Option(longName: "badge", Required = false, HelpText = "Include a badge reporting the Line Rate coverage in the output using shields.io - true or false.", Default = "false")] + public string BadgeString { get; set; } + + public bool Badge => BadgeString.Equals("true", StringComparison.OrdinalIgnoreCase); [Option(longName: "format", Required = false, HelpText = "Output Format - markdown or text.", Default = "text")] public string Format { get; set; } - [Option(longName: "indicators", Required = false, HelpText = "Include package health indicators in the output - true or false.", Default = true)] - public bool Indicators { get; set; } + [Option(longName: "indicators", Required = false, HelpText = "Include package health indicators in the output - true or false.", Default = "true")] + public string IndicatorsString { get; set; } + + public bool Indicators => IndicatorsString.Equals("true", StringComparison.OrdinalIgnoreCase); [Option(longName: "output", Required = false, HelpText = "Output Type - console, file or both.", Default = "console")] public string Output { get; set; } diff --git a/src/CodeCoverageSummary/Properties/launchSettings.json b/src/CodeCoverageSummary/Properties/launchSettings.json index d4e9905..583b9e3 100644 --- a/src/CodeCoverageSummary/Properties/launchSettings.json +++ b/src/CodeCoverageSummary/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "CodeCoverageSummary": { "commandName": "Project", - "commandLineArgs": "../../../../coverage.cobertura.xml --format=md --badge=true --thresholds=\"80 90\"" + "commandLineArgs": "../../../../coverage.cobertura.xml --format=md --badge true --thresholds=\"80 90\"" }, "Docker": { "commandName": "Docker",