Commandline: Can't disable a boolean argument with a default value of True

Created on 4 Nov 2017  路  8Comments  路  Source: commandlineparser/commandline

Issue by crmckenzie
_Tuesday Jan 14, 2014 at 18:47 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/115_


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

enhancement

Most helpful comment

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.

All 8 comments

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"

Comment by igitur
_Monday Sep 08, 2014 at 10:04 GMT_


I created a pull request for this. PR #133

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".

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. :)

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.

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

Seeing this as well

Fixed using nullable bool

Was this page helpful?
0 / 5 - 0 ratings