项目作者: wizaro

项目描述 :
.Net CLI Support Library
高级语言: C#
项目地址: git://github.com/wizaro/CommandLine.git
创建时间: 2020-10-27T05:59:29Z
项目社区:https://github.com/wizaro/CommandLine

开源协议:MIT License

下载


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.:

    1. Start.DefineCommandLine(rootBuilder => rootBuilder
    2. .AddCommand("HelloWorld", commandBuilder => commandBuilder
    3. .SetDescription("Salutes the globe.")
    4. .UseHandler(CommandHandler.Create(HelloWorld)))
    5. .AddCommand("Show", commandBuilder => commandBuilder
    6. .SetDescription("Shows a message prettily.")
    7. .AddOption<string>(new[] { "--message", "-m" }, optionBuilder => optionBuilder
    8. .Require())
    9. .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