Skip to content

Can't disable a boolean argument with a default value of True #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericnewton76 opened this issue Nov 4, 2017 · 8 comments
Closed

Comments

@ericnewton76
Copy link
Member

Issue by crmckenzie
Tuesday Jan 14, 2014 at 18:47 GMT
Originally opened as gsscoder/commandline#115


-c false should turn off the switch for -c.

@ericnewton76
Copy link
Member Author

Comment by nemec
Tuesday Jan 14, 2014 at 19:38 GMT


public bool MyValue { get { return _myValue; } set { _myValue = !value; } }

Just kidding.

That's actually a really good idea and it lets the boolean value be scripted: MyApplication.exe -c "$myBool"

@ericnewton76
Copy link
Member Author

Comment by igitur
Monday Sep 08, 2014 at 10:04 GMT


I created a pull request for this. PR #133

@ericnewton76
Copy link
Member Author

Comment by Kimi-Arthur
Tuesday Jun 16, 2015 at 06:14 GMT


Here is a solution I think is good.
For long option, provide a 'no' option to negate it.
Like "--dryrun" can be negated with "--nodryrun".

@ericnewton76
Copy link
Member Author

Comment by Mizipzor
Sunday Jun 21, 2015 at 08:30 GMT


@igitur, as you can see in the issue history your PR is listerd here since you referenced this issue number in it, GitHub does this automatically. :)

@ericnewton76
Copy link
Member Author

Comment by n074v41l4bl34u
Thursday Feb 16, 2017 at 20:36 GMT


To me it seems more like a bug then an enhancement. Either way it is a small thing and already fixed in other branches so implementing it might be an easy win for the project.

@alexandre-lecoq
Copy link

It doesn't seem to be fixed in 2.2.1. Any idea when the fix will be released ?

@anderslyman
Copy link

Seeing this as well

@moh-hassan
Copy link
Collaborator

Fixed using nullable bool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants