-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Customer ReportedBugs reported by customersBugs reported by customersbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Milestone
Description
Description
I have an option specified as
[Name("c", "check")]
[Description("Reports the amount of duplicates without changing anything")]
[DefaultValue(true)] // Note defaults to true and not required
public bool OnlyCheck { get; set; }
But still it prints the usages when it should not print them in this case.
Run without specifying the "check" option as CLI argument.
Workaround
Current workaround: setting AutoPrintUsageAndErrors = false
.
Todo
Problem is caused by CommandLineParser`TOption.cs#L255-L265.
We wrongly assume noArgsSupplied
means we should print the usage.
This is mostly correct but there is a scenario where this shouldn't.
A scenario where we only have optional options that have at least one with DefaultValue
specified.
Metadata
Metadata
Assignees
Labels
Customer ReportedBugs reported by customersBugs reported by customersbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed