Sharpify.CommandLineInterface 1.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Sharpify.CommandLineInterface --version 1.2.2                
NuGet\Install-Package Sharpify.CommandLineInterface -Version 1.2.2                
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="Sharpify.CommandLineInterface" Version="1.2.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharpify.CommandLineInterface --version 1.2.2                
#r "nuget: Sharpify.CommandLineInterface, 1.2.2"                
#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 Sharpify.CommandLineInterface as a Cake Addin
#addin nuget:?package=Sharpify.CommandLineInterface&version=1.2.2

// Install Sharpify.CommandLineInterface as a Cake Tool
#tool nuget:?package=Sharpify.CommandLineInterface&version=1.2.2                

CHANGELOG

Version 1.2.2

  • Rewritten core function of argument forwarding to fix issue that caused non-positional arguments to be removed, now named arguments and flags should not be affected by positional forwarding at all.
    • Important note: the Args array that is stored within the Arguments object, is never modified and no matter how many positional forwarding iterations have been executed, it maintains the original arguments.
  • Added Arguments.HasFlag(string) method that could be used to specifically checks for flags.
    • Previously Arguments.Contains(string) could be used for this purpose, but it could also return true for a named argument, effectively allowing a false-positive. HasFlag prevents this by checking that if it exists, the value is empty, which could only be the case for flags.
  • Increased buffer size for help-text generation to prevents issues with complex clis.

Usage Note

In case you are writing a cli which has a complex tree to navigate on the way to the execution, such as nested commands, and any single command processing gets verbose, remember that it is possible to create a CliRunner at any point.

This means that you can create objects for the nested commands, inside the top level command you could then forward the positional arguments (or not) if you choose, then use the same builder pattern with CliRunner.CreateBuilder()... and add the nested commands, then execute using the already parsed Arguments object as the CliRunner.RunAsync also has an overload that accepts Arguments.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.5.0 162 11/13/2024
1.4.0 274 10/21/2024
1.4.0-Alpha 66 10/10/2024
1.3.0 69 7/26/2024
1.2.2 100 7/3/2024
1.2.1 100 6/4/2024
1.2.0 125 3/13/2024
1.1.0 118 1/25/2024
1.0.5 110 1/22/2024
1.0.4 106 1/20/2024
1.0.3 97 1/20/2024
1.0.1 118 1/15/2024
1.0.0 105 1/15/2024