Skip to content
Ty Smith edited this page Dec 9, 2018 · 4 revisions

ArgParser

Flexible argument parsing library and help screen generator demo

Why?

Most existing libraries in this space do so using attributes and reflection. I find this approach to be restrictive and not conducive to extension. Extension is important because there a seemingly infinite amount of styles for how args should be interpretted.

  • switch style
    • -h, --help, /?, -help, --value=something, value:something
  • groupable parameters
    • git commit -am something
  • sub commands
    • dotnet new
  • count switches
    • -vvv

Goal

Provide a framework that allows for the creation of any type of argument parser, and a set of extensions that allow the user to opt into common styles.

It needs to be fairly trivial to create parsers for some of the most commonly used commands: git, find, dotnet along with similar help generation.

Install + Start Hacking

Install-Package ArgParser -Version 1.0.0-rc3
dotnet add package ArgParser --version 1.0.0-rc3
paket add ArgParser --version 1.0.0-rc3

Setup your context

Parse some args

Clone this wiki locally