dotmake-build / command-line

Declarative syntax for System.CommandLine via attributes for easy, fast, strongly-typed (no reflection) usage. Includes a source generator which automagically converts your classes to CLI commands and properties to CLI options or CLI arguments.
https://dotmake.build
MIT License
79 stars 6 forks source link

V1.5 gives a warning with nullable strings #3

Closed lookbusy1344 closed 10 months ago

lookbusy1344 commented 10 months ago

In version 1.5 nullable string properties give a warning:

[CliOption(Description = "Description for Extra")]
public string? Extra { get; set; }

Warning DMCLI33 DotMake.CommandLine.SourceGeneration -> The property 'Extra' has custom type 'string?' (other than supported CLR types) so it should have a public constructor or a static 'Parse' method with a string parameter, so that it can be bound/parsed as a CLI option .

I guess string? can be parsed automatically just like string

calacayir commented 10 months ago

Well, I rushed the release, seems missed a check with nullable but that warning should not be harmful (if you can run and the option is parsed correctly). I will fix it shortly.

calacayir commented 10 months ago

This is fixed now in v1.5.2