Issue with boolean switch after verb
Issue When using a boolean switch after a verb, I cannot set it to false
Example: app.exe install --feature=false
Options class
[Verb("install", HelpText = "Install something")]
class Options
{
[Option('f', "feature", Required = false, Default = true, HelpText = "Enable a feature")]
public bool EnableFeature { get; set; }
}
Expected: Feature = False
Actual result: Feature = True
Demo code: https://dotnetfiddle.net/lSBqxp
Edit1 Add Options class code
I've met the same issue, whatever you input, the result for the bool option is always true.
It's so mess.
I've also had the same problem.
PS
This project is a neat way to add commandline options to your app. Thanks 👍
I found here that you can workaround it if you make bools nullable, i.e. bool? instead of bool.
It's weird and unexpected, and clearly a recurring issue. It should at least throw an error if I do --xxx=false on a non-nullable boolean.
I'm having the same issue
Related to #702