question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with boolean switch after verb

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
greatkekecommented, Oct 13, 2021

I’ve met the same issue, whatever you input, the result for the bool option is always true. It’s so mess.

0reactions
olfekcommented, Dec 31, 2021

Related to #702

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found