Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Nick-Lucas/EntryPoint
Composable CLI Argument Parser for all modern .Net platforms.
https://github.com/Nick-Lucas/EntryPoint
cli command-line core declarative dotnet entrypoint net nuget parser
Last synced: 3 months ago
JSON representation
Composable CLI Argument Parser for all modern .Net platforms.
- Host: GitHub
- URL: https://github.com/Nick-Lucas/EntryPoint
- Owner: Nick-Lucas
- License: mit
- Created: 2016-12-23T01:40:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-22T20:15:45.000Z (over 5 years ago)
- Last Synced: 2024-07-31T21:53:17.802Z (5 months ago)
- Topics: cli, command-line, core, declarative, dotnet, entrypoint, net, nuget, parser
- Language: C#
- Homepage: https://nick-lucas.github.io/EntryPoint/
- Size: 783 KB
- Stars: 137
- Watchers: 12
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-csharp - EntryPoint - Composable CLI Argument Parser for .NET Core & .NET Framework 4.5+. (CLI)
- awesome-dotnet-cn - EntryPoint - 用于.NET Core 与 .NET Framework 4.5+ 的可组合的CLI参数解析器。 (CLI)
- awesome-dotnet - EntryPoint - Composable CLI Argument Parser for .NET Core & .NET Framework 4.5+. (CLI)
- awesome-dotnet - EntryPoint - Composable CLI Argument Parser for .Net Core & .Net Framework 4.5+. (CLI)
- awesome-dot-dev - EntryPoint - Composable CLI Argument Parser for .NET Core & .NET Framework 4.5+. (CLI)
- awsome-dotnet - EntryPoint - Composable CLI Argument Parser for .NET Core & .NET Framework 4.5+. (CLI)
- awesome-dotnet - EntryPoint - Composable CLI Argument Parser for .NET Core & .NET Framework 4.5+. (CLI)
README
[![Build status](https://ci.appveyor.com/api/projects/status/bocpkn9t5lhan1o9?svg=true)](https://ci.appveyor.com/project/Nick-Lucas/entrypoint)
[![NuGet](https://img.shields.io/nuget/v/EntryPoint.svg)](https://www.nuget.org/packages/EntryPoint)
[![MIT License](https://img.shields.io/github/license/Nick-Lucas/EntryPoint.svg)](https://github.com/Nick-Lucas/EntryPoint/blob/master/LICENSE)## EntryPoint
Composable CLI Argument Parser for all modern .Net platforms
Parses arguments in the form `UtilityName [command] [-o | --options] [operands]`
Supports:
* .Net Standard 1.6+ (.Net Core and all future .Net releases are built on this)
* .Net Framework 4.5+Follows the [IEEE Standard](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) closely, but does include common adblibs such as fully named `--option` style options.
## Installation
EntryPoint is available on [NuGet](https://www.nuget.org/packages/EntryPoint):PM> Install-Package EntryPoint
Pull requests and suggestions are welcome, and some small tasks are already in the Issues.
## Documentation
* Full documentation: https://nick-lucas.github.io/EntryPoint/
* Example Implementation: https://github.com/Nick-Lucas/EntryPoint/tree/master/test/Example
## As simple as...
Parse your application's Command Line Arguments into a declarative POCO, in one line.
Arguments are defined as declarative POCOs using Attributes.
```C#
var arguments = Cli.Parse(args);
if (arguments.Option) {
// ...
};
```
```C#
public class CliArguments : BaseCliArguments {
public CliArguments() : base("MyApplication") { }[Option(ShortName: 'o',
LongName: "option-1")]
public bool Option { get; set; }
}
```Commands have a dedicated API:
```C#
Cli.Execute(args);
```
```C#
public class CliCommands : BaseCliCommands {
[Command("primary")]
public void Primary(string[] args) {
// Arguments Parsing and Command Code...
}
}
```