fixed issue with bool parameters

This commit is contained in:
irongut
2021-10-19 00:03:22 +01:00
parent 6ed1f6c50d
commit 7c070aea38
2 changed files with 10 additions and 5 deletions
@@ -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; }
@@ -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",