Issue with boolean switch after verb
See original GitHub issueIssue 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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
switch / case request with boolean - java
Consider using an enum for each case to determine which current state you have instead of two doubles. So you can easily use...
Read more >Is there terminology for "true"ing, "false"ing, and toggling a ...
When you really need to talk about a boolean value, you can go with "set/reset", or "set to true" and "set to false"....
Read more >Boolean value doesnt change when casted from another BP
So the problem is that it won't move if the Boolean isn't set to true from beginning. Tried the overlap trigger, event tic...
Read more >Can we use Boolean in a switch statement?
No, you cannot use a Boolean (true/false) value directly in a switch statement in most programming languages. Switch statements are typically used to...
Read more >Tips on naming boolean variables - Cleaner Code
There is a convention to prefix boolean variables and function names with "is" or "has". You know, something like isLoggedIn , hasAccess or ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve met the same issue, whatever you input, the result for the bool option is always
true
. It’s so mess.Related to #702