NestedArgs 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package NestedArgs --version 1.0.1
                    
NuGet\Install-Package NestedArgs -Version 1.0.1
                    
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="NestedArgs" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NestedArgs" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="NestedArgs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NestedArgs --version 1.0.1
                    
#r "nuget: NestedArgs, 1.0.1"
                    
#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.
#:package NestedArgs@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NestedArgs&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=NestedArgs&version=1.0.1
                    
Install as a Cake Tool

NestedArgs

NestedArgs is a .NET library designed to streamline the creation and handling of complex command-line arguments in .NET applications. It allows for the definition of nested commands and options, making it easier to build intuitive and powerful command-line interfaces for your applications.

Key Advantages of NestedArgs

NestedArgs stands out among other command line parsing libraries due to several key features and advantages, including its support for Ahead-of-Time (AOT) compilation. Here are the main benefits:

  1. Hierarchical Command Structure: NestedArgs allows for defining commands and sub-commands in a nested, hierarchical manner. This feature is particularly useful for complex applications with multiple levels of commands and options, offering a more organized and intuitive user interface.

  2. Flexible Option Handling: The library provides extensive support for options, including long and short names, default values, required options, and more. This flexibility makes it easier to tailor the command line interface to the specific needs of the application.

  3. Intuitive API: NestedArgs offers a straightforward and fluent API, making it easy to define commands and options in a way that is both readable and maintainable.

  4. AOT Compilation Support: NestedArgs is compatible with Ahead-of-Time compilation, ensuring faster startup times and improved performance for applications that require it. This is particularly beneficial for environments where quick execution is crucial.

  5. Seamless .NET Integration: Designed specifically for .NET applications, NestedArgs integrates seamlessly with the .NET ecosystem, leveraging familiar patterns and practices.

  6. Automatic Help Generation: NestedArgs automatically generates help text for all commands and options, making it easier for end users to understand how to use the application.

  7. Customization and Extensibility: It offers ample opportunities for customization and can be extended to suit specific requirements, providing a balance between out-of-the-box functionality and adaptability.

  8. Lightweight and Efficient: The library is designed to be lightweight and efficient, minimizing the overhead added to your application.

In summary, NestedArgs provides a robust, user-friendly, and efficient solution for handling command line arguments in .NET applications, with the added advantage of AOT compilation support, making it an excellent choice for a wide range of use cases.

Getting Started

Installation

To install NestedArgs, use NuGet package manager:

Install-Package NestedArgs

or via the .NET CLI:

dotnet add package NestedArgs

Basic Usage

Here's a simple example to get you started with NestedArgs:

using NestedArgs;

internal class Program
{
    private static void Main(string[] args)
    {
        Command rootCommand = new CommandBuilder("myapp", "Description of my app.")
            .Option(new Option()
            {
                LongName = "option1",
                ShortName = 'o',
                Description = "A sample option",
                IsRequired = true
            })
            // Add more options and subcommands as needed
            .Build();

        var matches = rootCommand.Parse(args);
        // Your command handling logic here
    }
}
Product Compatible and additional computed target framework versions.
.NET 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.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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
1.0.2 300 3/4/2025
1.0.1 275 1/6/2024
1.0.0 225 1/6/2024