Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Command Line Parser Library - Boolean Parameter

$
0
0

I try to pass a boolean parameter to a console application and process the value with the Command Line Parser Library.

[Option('c', "closeWindow", Required = true, HelpText = "Close the window.")]
public bool CloseWindow { get; set; }

I tried to pass the parameter as

-c false
-c False
-c "false"
-...

There are no differences, on each try I get "true" as value.

Can anyone tell me how I have to pass the parameter to get the boolean false value?

To avoid possible asks, there is a string option which is passed correctly:

[Option('s', "system", Required = true, HelpText = "Any help text")]
public string System { get; set; }

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>