commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Support + (plus) sign for flags to UNSET a flag often used by Linux

Open ramonsmits opened this issue 3 years ago • 0 comments

All of the single letter options that have a corresponding name can be used as an argument to the -o option. The set -o name is provided next to the single letter option in the description below. Specifying a dash “-” turns the option on, while using a plus “+” disables the option.

Meaning, assume you have the following option:

[Option('x', "XXXX", Required = false, Default = true)]
public bool X { get; set; }

And you would pass +x, then the result should be False:

app.exe +x

This seems like a better approach then a nullable bool:

[Option('x', "XXXX", Required = false, Default = true)]
public bool? X { get; set; }

As that requires to pass:

app.exe -x false

ramonsmits avatar Jul 01 '22 15:07 ramonsmits