ConFlag 1.0.0
dotnet add package ConFlag --version 1.0.0
NuGet\Install-Package ConFlag -Version 1.0.0
<PackageReference Include="ConFlag" Version="1.0.0" />
<PackageVersion Include="ConFlag" Version="1.0.0" />
<PackageReference Include="ConFlag" />
paket add ConFlag --version 1.0.0
#r "nuget: ConFlag, 1.0.0"
#:package ConFlag@1.0.0
#addin nuget:?package=ConFlag&version=1.0.0
#tool nuget:?package=ConFlag&version=1.0.0
ConFlag
ConFlag is a simple single-class package to help you lightweightly manage your command line arguments.
Usage
Command line arguments are split into three groups: flags, options and commands.
If an argument starts with a single dash (-), followed by one or more letters, then they are interpreted as flags. Accessed via Arguments.Flags list.
If an argument starts with a double dash (--), followed by a string of text, then it is interpreted as an option. Option can optionally be followed by an equals sign (=) with a string of text following it (for example --sort=reverse), then the value after the equals sign will be interpreted as the current option's value. Accessed via Arguments.Options (string, string?) dictionary.
Lastly, a string of text not preceded by a dash or double dash is interpreted as a command (subcommand). Accessed via Arguments.Commands list.
using System;
using ConFlag;
namespace Example {
class Example {
static void Main(string[] args) {
// create the ConFlag Arguments class
Arguments arguments = new(args);
// check if -h or --help were passed as arguments
if(
arguments.Flags.Contains('h') ||
arguments.Options.ContainsKey("help")
)
{
Console.WriteLine("Example program usage: ...");
}
}
}
}
| 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. 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. |
-
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 |
|---|---|---|
| 1.0.0 | 177 | 10/26/2024 |