back to home

commandlineparser / commandline

The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support

4,805 stars
481 forks
323 issues
C#

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing commandlineparser/commandline in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/commandlineparser/commandline)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Command Line Parser Library for CLR and NetStandard **Note:** the API surface has changed since v1.9.x and earlier. If you are looking for documentation on v1.9.x, please see stable-1.9.71.2 The Command Line Parser Library offers CLR applications a clean and concise API for manipulating command line arguments and related tasks, such as defining switches, options and verb commands. It allows you to display a help screen with a high degree of customization and a simple way to report syntax errors to the end user. Nightly Build Nightly version of the CommandLineParser can be downloaded from github Releases. The Last new features and fixes, read changelog _NOTE: Mentioned F# Support is provided via package with FSharp dependencies._ __This library provides _hassle free_ command line parsing with a constantly updated API since 2005.__ At a glance: • Compatible with __.NET Framework 4.0+__, __Mono 2.1+ Profile__, __.NET Standard__ and __.NET Core__ • Doesn't depend on other packages (No dependencies beyond standard base libraries) • One line parsing using default singleton: and three overload methods. • Automatic or one line help screen generator: . • Supports , , and by default with customization. • Map to sequences (via and similar) and scalar types, including Enums and . • You can also map to every type with a constructor that accepts a string (like ) for reference and value types. • Verbs can be array of types collected from Plugins or IoC container. • Define verb commands similar to . • Support default verb. • Support Mutable and Immutable types. • Support HelpText localization. • Support ordering of options in HelpText. • Support Mutually Exclusive Options and Option groups. • Support named and value options. • Support Asynchronous programming with async and await. • Unparsing support: . • CommandLineParser.FSharp package is F#-friendly with support for , see demo. _NOTE: This is a separate NuGet package._ • Include wiki documentation with lot of examples ready to run online. • Support Source Link and symbolic nuget package snupkg. • Tested in Windows, Linux Ubuntu 18.04 and Mac OS. • Most of features applies with a CoC philosophy. • C# demo: source here. Getting Started with the Command Line Parser Library You can utilize the parser library in several ways: • Install via NuGet/Paket: https://www.nuget.org/packages/CommandLineParser/ • Integrate directly into your project by copying the .cs files into your project. • ILMerge during your build process. Quick Start Examples • Create a class to define valid options, and to receive the parsed options. • Call ParseArguments with the args string array. C# Quick Start: C# Examples: Click to expand! Demo to show IEnumerable options and other usage: Online Demo F# Examples: Click to expand! VB.NET Example: Click to expand! For verbs: • Create separate option classes for each verb. An options base class is supported. • Call ParseArguments with all the verb attribute decorated options classes. • Use MapResult to direct program flow to the verb that was parsed. C# example: Click to expand! VB.NET example: Click to expand! F# Example: Click to expand! Release History See the changelog Contributors First off, _Thank you!_ All contributions are welcome. Please consider sticking with the GNU getopt standard for command line parsing. Additionally, for easiest diff compares, please follow the project's tabs settings. Utilizing the EditorConfig extension for Visual Studio/your favorite IDE is recommended. __And most importantly, please target the branch in your pull requests!__ Main Contributors (alphabetical order): • Alexander Fast (@mizipzor) • Dan Nemec (@nemec) • Eric Newton (@ericnewton76) • Kevin Moore (@gimmemoore) • Moh-Hassan (@moh-hassan) • Steven Evans • Thomas Démoulins (@Thilas) Resources for newcomers: • Wiki • GNU getopt Contacts: • Giacomo Stelluti Scala • gsscoder AT gmail DOT com (_use this for everything that is not available via GitHub features_) • GitHub: gsscoder • Blog • Twitter • Dan Nemec • Eric Newton • ericnewton76+commandlineparser AT gmail DOT com • GitHub: ericnewton76 • Blog: • Twitter: enorl76 • Moh-Hassan