CommandLinePlus 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CommandLinePlus --version 1.0.0                
NuGet\Install-Package CommandLinePlus -Version 1.0.0                
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="CommandLinePlus" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommandLinePlus --version 1.0.0                
#r "nuget: CommandLinePlus, 1.0.0"                
#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 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last updated
2.3.0 525 11/4/2023
2.2.1 106 11/4/2023
2.2.0 169 10/28/2023
2.1.0 100 10/28/2023
2.0.0 92 10/23/2023
1.0.0 92 10/18/2023

Supports netstandard2.0 and net7.0