CommandLineArgsParser 1.0.0-beta.2
This is a prerelease version of CommandLineArgsParser.
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package CommandLineArgsParser --version 1.0.0-beta.2
NuGet\Install-Package CommandLineArgsParser -Version 1.0.0-beta.2
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="CommandLineArgsParser" Version="1.0.0-beta.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommandLineArgsParser" Version="1.0.0-beta.2" />
<PackageReference Include="CommandLineArgsParser" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommandLineArgsParser --version 1.0.0-beta.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CommandLineArgsParser, 1.0.0-beta.2"
#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.
#:package CommandLineArgsParser@1.0.0-beta.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommandLineArgsParser&version=1.0.0-beta.2&prerelease
#tool nuget:?package=CommandLineArgsParser&version=1.0.0-beta.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CommandLineArgsParser
Parse Command Line Arguments in C# cli applications into Option Names and Option Parameters
Inspired by Dart's args package though it's not a C# copy of it.
Usage
Example
For most CLI applications, having a help flag and a version flag is either desirable or necessary.
Here's an example of how this can be implemented.
using CommandLineArgsParser;
ArgParser argumentGrammar = new ArgParser();
argumentGrammar.AddFlag("help", isMandatory:false, "h", "Displays CLI usage information and help messages", null, null);
argumentGrammar.AddFlag("version",isMandatory: false, "v", "Displays the CLI tool name and version", null, null);
ArgResults argResults = argumentGrammar.Parse(args);
if (argResults.WasParsed("help"))
{
CliHelper.PrintHelpMessages(argumentGrammar);
}
if (argResults.WasParsed("version"))
{
CliHelper.PrintVersion();
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- AlastairLundy.System.Extensions (>= 3.0.1)
-
net8.0
- AlastairLundy.System.Extensions (>= 3.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|
* Fix an issue where attempting to parse some values would not be successful