Skip to content

Repository files navigation

.NET CoreIssuesCodeCovCodeFactorLicenseNuget

CommandLineParser

A simple, light-weight and strongly typed commandline parser made in .NET Standard!

Installation

PM>Install-Package MatthiWare.CommandLineParser

Quick Start

Example of configuring the port option using the Fluent API.

staticvoidMain(string[]args){// create the parservarparser=newCommandLineParser<ServerOptions>();// configure the options using the Fluent APIparser.Configure(options =>options.Port).Name("p","port").Description("The port of the server").Required();// parsevarparserResult=parser.Parse(args);// check for parsing errorsif(parserResult.HasErrors){Console.ReadKey();return-1;}varserverOptions=parserResult.Result;Console.WriteLine($"Parsed port is {serverOptions.Port}");}privateclassServerOptions{// optionspublicintPort{get;set;}}

Run command line

dotnet myapp --port 2551

For more advanced configuration options see the wiki.

Contributors

About

💻 A simple, light-weight and strongly typed Command Line Parser made in .NET Standard!

Topics

Resources

Security policy

Stars

34 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages