I've released an update to Ookii.CommandLine, my library for parsing command line arguments for .Net.
This new version comes with nullable reference type support (for .Net 6+), a new helper to make parsing easier, more customizability, an easier way to make -Help
style arguments, and some bug fixes.
See the full list of changes here.
With the new helper method, you can now just do the following to parse the arguments and write errors and usage to the console if parsing failed:
var parsed = CommandLineParser.Parse<MyArguments>(args);
And if you want to customize parsing behavior, you can still do so with this method:
var options = new ParseOptions() { NameValueSeparator = '=' }; var parsed = CommandLineParser.Parse<MyArguments>(args, options);
Of course, existing code to parse arguments that manually creates an instance of CommandLineParser
will continue to work.
Check it out on NuGet or GitHub, or try it out online!
Also, the Visual Studio code snippets (which previously required manual installation) are now available on the Visual Studio marketplace.
No comments here...
Comments are closed for this post. Sorry.