MASES.CLIParser 3.2.1

dotnet add package MASES.CLIParser --version 3.2.1                
NuGet\Install-Package MASES.CLIParser -Version 3.2.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MASES.CLIParser" Version="3.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MASES.CLIParser --version 3.2.1                
#r "nuget: MASES.CLIParser, 3.2.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MASES.CLIParser as a Cake Addin
#addin nuget:?package=MASES.CLIParser&version=3.2.1

// Install MASES.CLIParser as a Cake Tool
#tool nuget:?package=MASES.CLIParser&version=3.2.1                

CLI Parser

CI_BUILD CI_RELEASE

CLIParser
CLIParser nuget downloads

A library to manage command-line arguments in a simple way. It was an internal MASES project, now it is available to anyone.

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to coc_reporting@masesgroup.com.

How it works

The library is very simple in its usage. The definition of command-line switches is based on generic C# types. The parser fully analyze the command line searching for switches and arguments. A special case is the one where the swithes can be inserted within an external file listing the switches line-by-line. To see a real application of the library look at project JCOReflectorCLI and JCOReflectorEngine

Argument definition

An argument can be defined using the following syntax sinppets:

arg = new ArgumentMetadata<bool>()
{
	Name = "test",
	ShortName = "tst",
	Help = "this is a test",
	Type = ArgumentType.Double,
	ValueType = ArgumentValueType.Free,
}

arg1 = new ArgumentMetadata<int>()
{
	Name = "range",
	Default = 9,
	Type = ArgumentType.Double,
	ValueType = ArgumentValueType.Range,
	MinValue = 2,
	MaxValue = 10,
}

Parser initialization

Upon arguments are defined they can be added to the list managed from the parser using:

Parser.Add(arg);

or the compact version:

arg1.Add();

Parser use

Then it is possible to use the parser on command-line arguments:

Parser.Parse(args);

or the compact version:

args.Parse();

Argument check

When the Parse method returns, a list of prepared arguments is available. The list can be used to get value or check for existence.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MASES.CLIParser:

Package Downloads
MASES.JNet

Java/JVM suite for .NET - a comprehensive suite of libraries and tools to use Java/JVM APIs (Java, Scala, Kotlin, ...) and .NET side-by-side

MASES.JCOReflectorEngine

JCOReflector Engine - JCOBridge based Java class generator that mimic .NET classes

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.1 602,894 1/29/2024
3.2.0 155,058 11/14/2023
3.1.2 674,956 4/6/2022
3.1.1 1,032 4/5/2022
3.1.0 797 4/4/2022
3.0.0 9,270 3/9/2022
2.2.1 2,617 1/6/2022
2.2.0 1,881 10/28/2021
2.1.2 1,641 10/8/2021
2.1.1 702 10/7/2021
2.1.0 683 10/6/2021
2.0.0 682 9/14/2021
1.1.0 898 8/31/2021