dotnet / CliCommandLineParser

A second-generation parser for the .NET Core command line tools
MIT License
111 stars 44 forks source link

Create.Option accepts a materialize but does nothing with it #65

Closed xgalaxy closed 7 years ago

xgalaxy commented 7 years ago

The helper method Create.Option can take an optional materialize argument but it does nothing with it. This stumped me a little bit as I thought I could do something like the following:

// this doesn't work
private static Option VersionOption() =>
      Create.Option("--version", "Show version information",
            materialize: o => "My Version 1.0.0");

// this works
private static Option VersionOption() =>
      Create.Option("--version", "Show version information",
            Accept.NoArguments().MaterializeAs(o => "My Version 1.0.0"));
jonsequitur commented 7 years ago

Good catch!