Skip to content

wizaro/CommandLine

Repository files navigation

WiZaRo's Command Line Interface Library

Support library to build CLI applications in .Net.

Features

See the latest changes in the Changelog.

Usage

Prerequisites

Coming soon…

Installation

Coming soon…

Examples

Buildable examples can be found in the Xmpl directory.

WiZaRo.CommandLine.Fluent

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 the HelloWorld() method; and
    • The Show 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.

Documentation

Coming soon…

Support

Open a new issue at Issues.

Roadmap

  • Create a Nuget package.
  • Add prerequisites and intallation guidance.
  • Add documentation.

Contributing

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.

Authors

Wilhelm Zapiain

Acknowledgments

Thanks to all contributors at System.CommandLine.

License

MIT - Summary