CommandLinePlus 1.0.0
See the version list below for details.
dotnet add package CommandLinePlus --version 1.0.0
NuGet\Install-Package CommandLinePlus -Version 1.0.0
<PackageReference Include="CommandLinePlus" Version="1.0.0" />
paket add CommandLinePlus --version 1.0.0
#r "nuget: CommandLinePlus, 1.0.0"
// Install CommandLinePlus as a Cake Addin #addin nuget:?package=CommandLinePlus&version=1.0.0 // Install CommandLinePlus as a Cake Tool #tool nuget:?package=CommandLinePlus&version=1.0.0
CommandLinePlus
This project started because I needed a command line parser that could:
- Have a primary option
- Have a sub option
- Accept command line parameters
This allows a developer to construct a command line in the following form:
myprog.exe Option SubOption -param:value
Supports
- Net7.0
- Netstandard2.0
How it works
Create a class which descends from BaseCommandLine, specify the name (primary option) and create methods (each method is a sub option)
In the following example we can these command lines:
myprog.exe Plugin /p:myplugin
myprog.exe Plugin Add -p:myplugin
myprog.exe Plugin Remove --p:myplugin
myprog.exe Plugin Disable /p:myplugin
myprog.exe Plugin Enable -p:myplugin
internal class PluginProcessor : BaseCommandLine
{
public override string Name => "Plugin";
public override int SortOrder => 0;
public override bool IsEnabled => true;
public override void DisplayHelp(IDisplay display)
{
display.WriteLine("Plugin");
display.WriteLine(" Add");
display.WriteLine(" Remove");
display.WriteLine(" Disable");
display.WriteLine(" Enable");
display.WriteLine(" -p Name of plugin");
}
public override void Execute(string[] args)
{
// default handler when no sub option specified
}
public void Add(string p)
{
}
public void Remove(string p)
{
}
public void Disable(string p)
{
}
public void Enable(string p)
{
}
}
Available Paramater seperators
The following characters can be used as param seperators
- = (equals)
- : (colon)
Available Paramater Idetifiers
The following are used to identify parameter values
- (-) (single dash) doesn't need the brackets except in markdown :-\
- -- (double dash)
- / (forward slash)
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 is compatible. 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. |
-
.NETStandard 2.0
- No dependencies.
-
net7.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.
Supports netstandard2.0 and net7.0