CliArgsParser 0.6.0-preview-202404091651
Suggested Alternatives
This is a prerelease version of CliArgsParser.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package CliArgsParser --version 0.6.0-preview-202404091651
NuGet\Install-Package CliArgsParser -Version 0.6.0-preview-202404091651
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="CliArgsParser" Version="0.6.0-preview-202404091651" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CliArgsParser --version 0.6.0-preview-202404091651
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CliArgsParser, 0.6.0-preview-202404091651"
#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 CliArgsParser as a Cake Addin #addin nuget:?package=CliArgsParser&version=0.6.0-preview-202404091651&prerelease // Install CliArgsParser as a Cake Tool #tool nuget:?package=CliArgsParser&version=0.6.0-preview-202404091651&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CliArgsParser-cs
Empowering developers to effortlessly craft CLI tools or streamline the parsing of program arguments with ease.
Examples
A full suite of example projects can be found on the Github repo here
Below are some small scale examples:
Parsing of Program Arguments
using CliArgsParser;
using CliArgsParser.Attributes;
public class ArgOptions : ParameterOptions {
[ArgValue('u', "username")] public string? Username { get; set; }
}
public class CommandAtlas : CliCommandAtlas {
[CliCommand<ArgOptions>("test")]
public void CallbackTest(ArgOptions argOptions) {
Console.WriteLine(argOptions.Username != null ?
$"Hello, {argOptions.Username}!" :
"Hello, stranger"
);
}
}
static class Program {
public static void Main(string[] args) {
new CliArgsParser.CliArgsParser()
.RegisterFromCliAtlas(new CommandAtlas())
.TryParseMultiple(args);
}
}
input | output |
---|---|
test |
Hello, stranger |
test -u Andreas |
Hello, Andreas |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
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 | |
---|---|---|---|
2.1.2 | 152 | 8/27/2024 | |
2.1.1 | 90 | 8/27/2024 | |
2.0.0 | 87 | 8/27/2024 | |
1.1.3 | 134 | 6/13/2024 | |
1.1.2 | 94 | 6/8/2024 | |
1.1.1 | 123 | 6/6/2024 | |
1.1.0 | 95 | 6/6/2024 | |
1.0.5 | 126 | 5/8/2024 | |
1.0.4 | 102 | 5/6/2024 | |
1.0.3 | 103 | 5/6/2024 | |
1.0.2 | 105 | 5/6/2024 | |
1.0.1 | 106 | 5/5/2024 | |
1.0.0 | 97 | 5/5/2024 | |
0.6.0-preview-202404091715 | 90 | 4/9/2024 | |
0.6.0-preview-202404091708 | 79 | 4/9/2024 | |
0.6.0-preview-202404091651 | 77 | 4/9/2024 | |
0.5.6 | 114 | 2/19/2024 | |
0.4.0 | 114 | 2/14/2024 | |
0.3.1 | 118 | 2/7/2024 | |
0.2.0 | 102 | 2/6/2024 | |
0.1.8 | 101 | 2/6/2024 | |
0.1.7 | 99 | 2/6/2024 | |
0.1.6 | 96 | 2/6/2024 | |
0.1.5 | 101 | 2/6/2024 | |
0.1.3 | 103 | 2/5/2024 |