Dans.StyleAgnosticCommandArgs.Library
26.2118.4210
dotnet add package Dans.StyleAgnosticCommandArgs.Library --version 26.2118.4210
NuGet\Install-Package Dans.StyleAgnosticCommandArgs.Library -Version 26.2118.4210
<PackageReference Include="Dans.StyleAgnosticCommandArgs.Library" Version="26.2118.4210" />
<PackageVersion Include="Dans.StyleAgnosticCommandArgs.Library" Version="26.2118.4210" />
<PackageReference Include="Dans.StyleAgnosticCommandArgs.Library" />
paket add Dans.StyleAgnosticCommandArgs.Library --version 26.2118.4210
#r "nuget: Dans.StyleAgnosticCommandArgs.Library, 26.2118.4210"
#:package Dans.StyleAgnosticCommandArgs.Library@26.2118.4210
#addin nuget:?package=Dans.StyleAgnosticCommandArgs.Library&version=26.2118.4210
#tool nuget:?package=Dans.StyleAgnosticCommandArgs.Library&version=26.2118.4210
Style-Agnostic Command-Line Arguments
This tiny library allows you to support the user's own command line parameter preference by accepting either the -- or / prefixes on each parameter.
A parameter name is interpreted if the parameter begins with the pattern [A-Za-z0-9-_]: Zero or more white-spaces are ignored after the colon character. A parameter name is not required, and its Name property will be an empty string if not supplied.
Immediately after parsing, the CommandArgCollection contains a list of CommandArgItem items, each having separate Name and Value properties.
Example Application
The following example demonstrates this library in action.
CommandArgCollection commandArgs = new CommandArgCollection(args);
foreach(CommandArgItem argItem in commandArgs)
{
key = argItem.Name.ToLower();
switch(key)
{
case "":
// When no name was specified, check for the value.
key = argItem.Value.ToLower();
switch(key)
{
case "?":
bShowHelp = true;
break;
case "wait":
prg.mWaitAfterEnd = true;
break;
}
break;
case "action":
if(Enum.TryParse<PActionTypeEnum>(argItem.Value,
true, out action))
{
if(action != PActionTypeEnum.None)
{
prg.ActionItem.Action = action;
bActivity = true;
}
else
{
message.Append("Error: No action specified...");
bShowHelp = true;
break;
}
}
else
{
message.Append("Error: Unknown action specified...");
}
break;
}
}
Updates
| Version | Description |
|---|---|
| 26.2118.4210 | Initial publication to NuGet. |
More Information
For more information, please see the GitHub project: danielanywhere/StyleAgnosticCommandArgs
Full API documentation is available at this library's GitHub User Page.
| Product | Versions 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. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- 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 |
|---|---|---|
| 26.2118.4210 | 82 | 1/18/2026 |