.Net CLI Support Library
Support library to build CLI applications in .Net.
See the latest changes in the Changelog.
Coming soon…
Coming soon…
Buildable examples can be found in the Xmpl directory.
The static class WiZaRo.CommandLine.Fluent.Start
contains the entry points to the fluent API.
The method DefineCommandLine(Action<CommandBuilder>)
allows to define a command line API explicitly in a fluent way, i.e.:
Start.DefineCommandLine(rootBuilder => rootBuilder
.AddCommand("HelloWorld", commandBuilder => commandBuilder
.SetDescription("Salutes the globe.")
.UseHandler(CommandHandler.Create(HelloWorld)))
.AddCommand("Show", commandBuilder => commandBuilder
.SetDescription("Shows a message prettily.")
.AddOption<string>(new[] { "--message", "-m" }, optionBuilder => optionBuilder
.Require())
.UseHandler(CommandHandler.Create<string, IFormatter>(Show))))
The previous example creates two commands:
HelloWorld
command with no options managed by the HelloWorld()
method; andShow
command with a required --message
option and managed by the Show(string, IFormatter)
method.The methods DefineCommandLineFrom
allows to define a command line API from a pre-existing or generated RootCommand
.
A complete example can be found at Fluent Example.
Coming soon…
Open a new issue at Issues.
Please read our Contribution Guidelines for details on our code of conduct, how to set your environment and the process for submitting pull requests to us.
Thanks to all contributors at System.CommandLine.