commandline
commandline copied to clipboard
Parsing fails on nullable types
The command line myapp -s 60 will fail to parse using the following code:
static void Main ( string[] args )
{
var result = CommandLine.Parser.Default.ParseArguments<Options>(args);
if ( result.Errors.Any() ) { return; }
Console.WriteLine(result.Value.SetRefreshRate);
}
public class Options
{
[CommandLine.Option('s', "SetRefreshRate")]
public int? SetRefreshRate { get; set; }
}
According to https://github.com/cosmo0/commandline/wiki/Mapping-Properties-To-Options this should be supported.
Tested on 2.0.0.0 and 2.1.0.0