SimpleCommandlineParser 1.3.4

dotnet add package SimpleCommandlineParser --version 1.3.4
NuGet\Install-Package SimpleCommandlineParser -Version 1.3.4
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="SimpleCommandlineParser" Version="1.3.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleCommandlineParser --version 1.3.4
#r "nuget: SimpleCommandlineParser, 1.3.4"
#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 SimpleCommandlineParser as a Cake Addin
#addin nuget:?package=SimpleCommandlineParser&version=1.3.4

// Install SimpleCommandlineParser as a Cake Tool
#tool nuget:?package=SimpleCommandlineParser&version=1.3.4

SimpleCommandLineParser

Simple and straight forward command line parser for dotnet console apps

Project URL:

https://github.com/PhilippeRaemy/SimpleCommandLineParser

Usage:

namespace UsageExample
{
    using System;
    using System.Globalization;
    using SimpleCommandlineParser;

    class Program
    {
        static int _number;

        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            bool _mySwitch;
            string _command = "GuessWhat";
            var parser = new Parser()
                .WithHelpWriter(Console.WriteLine)
                .WithErrorWriter(Console.Error.WriteLine)
                .AddHelpSwitch()
                .AddSwitch("mySwitch", () => _mySwitch = true, "command line switch")
                .AddStringParameter("Command", a => _command = a, "The command to be executed", _command)
                .AddOptionalIntegerParameter("Number", a => _number = int.Parse(a, NumberStyles.Integer, CultureInfo.InvariantCulture),
                    "An integer parameter"
                .Run(args);
                
            parser.EchoParameters();
            Console.WriteLine(parser.GetHelp());
        }
    }
}

When called as
UsageExample --MySwitch --number=1 --command=HelloWorld
the output of this simple console app would be:

Hello World!
 running with parameters: --myswitch --number=1 --command=HelloWorld

 usage is:
[--help]     : Get help on parameters
------------
[--myswitch] : command line switch
------------
 --command   : The command to be executed
             : Example: GuessWhat
------------
 --number    : An integer parameter
------------

C:\dev\SimpleCommandLineParser\UsageExample\bin\Release\netcoreapp3.1\UsageExample.exe (process 43588) exited with code 0.```
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.1

    • No dependencies.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net6.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.3.4 177 10/17/2023
1.3.3 82 10/17/2023
1.3.2 78 10/17/2023
1.3.1 68 10/17/2023
1.3.0 68 10/17/2023
1.2.0 852 5/24/2021
1.1.2 376 9/14/2020
1.1.1 364 9/14/2020
1.1.0 374 9/11/2020
1.0.0 401 9/11/2020

Release 1.2 introduces chainable methods to add parameters ane invoke parsing, lambdas and switch actions
       In release 1.3 the help text has been refactored for better readability.