Skip to content

Commit

Permalink
Merge branch 'release/0.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wilhelmzapiain committed Nov 14, 2020
2 parents 38766f3 + 074bb82 commit f5a8a5d
Show file tree
Hide file tree
Showing 53 changed files with 4,148 additions and 1,131 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ StyleCopReport.xml
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
- Some bug fixed.
-->

## [Unreleased]
## [0.1.0]
### Added
- WiZaRo.CommandLine.Fluent namespace, a fluent API for System.CommandLine.

## [0.0.0] - 2020-10-26
- Project creation.
Expand Down
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Support library to build CLI applications in .Net.

## Features
<!--This section contains a list of the features this project provides, including differentiating factors to alternatives.-->
- Provides fluent extensions for [System.CommandLine].
- WiZaRo.CommandLine.Fluent: Provides fluent extensions for [System.CommandLine].

See the latest changes in the [Change Log].

Expand All @@ -26,19 +26,44 @@ Coming soon…

### Examples
<!--This section shows examples of usage and the expected output if possible. It's helpful to have the smallest example of usage that can be demonstrated inline, while providing links to more sophisticated examples if they are too long to include reasonably.-->
Coming soon…
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.:
```C#
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
<!--This section provides a link to the project's documentation.-->
Coming soon…

### Support
<!--This section tells people where they can go to for help. It can be in the combination of an issue tracker, a chat room, an email address, etc.-->
Coming soon…
Open a new issue at [Issues].

## Roadmap
<!--This section contains ideas for releases in the future, or an indication if development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing it to keep going. An explicit request for maintainers can be made.-->
Coming soon…
- 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.
Expand All @@ -47,17 +72,20 @@ Please read our [Contribution Guidelines] for details on our code of conduct, ho
<!--This section contains appreciation to those who have contributed to the project.-->
[Wilhelm Zapiain]

<!--## Acknowledgments-->
## Acknowledgments
<!-- This sections contains any acknowledgments that need to be made.-->
<!--{Acknowledments}-->
Thanks to all contributors at [System.CommandLine].

## License
[MIT] - [Summary]

<!--Links-->
[Change Log]: ./CHANGELOG.md
[Contribution Guidelines]: ./CONTRIBUTING.md
[Fluent Example]: ./Xmpl/Core/Fluent/FluentExample.cs
[Issues]: https://github.com/wizaro/CommandLine/issues
[MIT]: ./LICENSE
[System.CommandLine]: https://github.com/dotnet/command-line-api
[Summary]: https://choosealicense.com/licenses/mit/ "Choose a License's MIT Summary"
[Wilhelm Zapiain]: https://github.com/wilhelmzapiain
[Wilhelm Zapiain]: https://github.com/wilhelmzapiain
[Xmpl]: ./Xmpl "Examples"
Loading

0 comments on commit f5a8a5d

Please sign in to comment.