GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MatthiWare/CommandLineParser.Core: :computer: A simple, light-weight and strongly typed Command Line Parser made in .NET Standard!

BranchesTags
Open more actions menu

Latest commit

 

History

169 Commits
169 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
CommandLineParser.Tests
CommandLineParser.Tests
 
 
CommandLineParser
CommandLineParser
 
 
Extensions
Extensions
 
 
SampleApp
SampleApp
 
 
Tests/TestAssembly
Tests/TestAssembly
 
 
.gitignore
.gitignore
 
 
CommandLineParser.sln
CommandLineParser.sln
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
codecov.yml
codecov.yml
 
 

Repository files navigation

.NET Core Issues CodeCov CodeFactor License Nuget

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.

static void Main(string[] args)
{
   // create the parser
   var parser = new CommandLineParser<ServerOptions>();
   
   // configure the options using the Fluent API
   parser.Configure(options => options.Port)
      .Name("p", "port")
      .Description("The port of the server")
      .Required();

   // parse
   var parserResult = parser.Parse(args);

   // check for parsing errors
   if (parserResult.HasErrors)
   {
      Console.ReadKey();

      return -1;
   }

   var serverOptions = parserResult.Result;

   Console.WriteLine($"Parsed port is {serverOptions.Port}");
}

private class ServerOptions
{
   // options
   public int Port { 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

command-line-interfacecommand-line-parsercommandlinedotnet-coredotnet-standard

Resources

Readme
MIT license

Security policy

Security policy
Activity
Custom properties

Stars

34 stars

Watchers

3 watching

Forks

8 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.