Support library to build CLI applications in .Net.
- WiZaRo.CommandLine.Fluent: Provides fluent extensions for System.CommandLine.
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:
- The
HelloWorld
command with no options managed by theHelloWorld()
method; and - The
Show
command with a required--message
option and managed by theShow(string, IFormatter)
method.
- The
-
The methods
DefineCommandLineFrom
allows to define a command line API from a pre-existing or generatedRootCommand
.
A complete example can be found at Fluent Example.
Coming soon…
Open a new issue at Issues.
- Create a Nuget package.
- Add prerequisites and intallation guidance.
- Add documentation.
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.