NFlags 1.7.2

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

// Install NFlags as a Cake Tool
#tool nuget:?package=NFlags&version=1.7.2                

NFlags

Simple yet powerfull library to made parsing CLI arguments easy. Library also allow to print usage help and application version "out of box".

For example of usage check Examples directory.

QuickStart

  1. Install NFLags from NuGet.
  2. Start new console project.
  3. Configure NFLags:
Cli.Configure(configure => configure
    .SetDialect(Dialect.Gnu)
    .SetName("QuickStart")
    .SetDescription("This is NFlags")
    .EnableVersionOption()
)
.Root(rc => rc
    .RegisterFlag("flag1", "f", "Flag description", false)
    .RegisterOption("option", "o", "Option description", "optionDefaultValue")
    .RegisterParameter("param", "Param description", "ParamDefaultValue")
    .RegisterCommand("subcommand", "Subcommand Description", sc => sc
            .SetExecute((commandArgs, output) => output.WriteLine("This is subcommand: " + commandArgs.GetParameter<string>("SubParameter")))
            .RegisterParameter("SubParameter", "SubParameter description", "SubParameterValue")
    )
    .RegisterParamSeries("paramSeries", "paramSeriesDescription")
    .SetExecute((commandArgs, output) => output.WriteLine("This is root command: " + commandArgs.GetParameter<string>("param")))
).
Run(args);

Run application and enjoy:

$> dotnet NFlags.QuickStart.dll
This is root command: ParamDefaultValue%
$> dotnet NFlags.QuickStart.dll xxx
This is root command: xxx
$> dotnet NFlags.QuickStart.dll --help
Usage:
        QuickStart [COMMAND] [OPTIONS]... [PARAMETERS]...

This is NFlags

        Commands:
        command Sub command Description

        Parameters:
        <param> Param description (Default: 'ParamDefaultValue')
        <paramSeries...>        paramSeriesDescription

        Options:
        --flag1, -f     Flag description
        --option <option>, -o <option>  Option description (Default: 'optionDefaultValue')
        --help, -h      Prints this help
        --version, -v      Prints application version



$> dotnet NFlags.QuickStart.dll subcommand
This is subcommand: SubParameterValue
$> dotnet NFlags.QuickStart.dll subcommand yyy
This is subcommand: yyy
$> dotnet NFlags.QuickStart.dll command --help
Usage:
        QuickStart command [OPTIONS]... [PARAMETERS]...

This is NFlags

        Parameters:
        <Parameter>     Sub parameter description (Default: 'SubParameterValue')

        Options:
        --help, -h      Prints this help
        --version, -v      Prints application version

$> 

Documentation

See details on NFlags GitHub pages

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 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 netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on NFlags:

Package Downloads
NetMicro.RabbitMQ.NFlags

Package Description

NetMicro.MongoDB.NFlags

Package Description

NetMicro.Monitoring.Prometheus.NFlags

Package Description

NetMicro.Auth.Jwt.NFlags

Package Description

NetMicro.Consul.NFlags

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.10.0 1,087 12/20/2021
1.9.0 482 11/15/2020
1.8.0 697 3/15/2020
1.7.2 2,010 11/3/2019
1.7.1 5,423 6/27/2019
1.7.0 723 4/7/2019
1.6.0 757 2/18/2019
1.5.0 779 2/2/2019
1.4.0.1 833 11/16/2018
1.4.0 820 11/14/2018
1.3.1 844 11/9/2018
1.3.0 817 11/2/2018
1.2.1 876 8/22/2018
1.1.1 1,158 12/15/2017
1.1.0-rc 1,356 11/3/2017
1.0.0 1,338 11/1/2017