Description
Simple library to made parsing CLI arguments easy.
Library allows to print usage help "out of box".
For example of usage check Examples directory.
NFlags alternatives and similar packages
Based on the "CLI" category.
Alternatively, view NFlags alternatives based on common mentions on social networks and blogs.
-
spectre.console
A .NET library that makes it easier to create beautiful console applications. -
Command Line Parser
The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support -
Sieve
⚗️ Clean & extensible Sorting, Filtering, and Pagination for ASP.NET Core -
Console Framework
Cross-platform toolkit for easy development of TUI applications. -
Fluent Command Line Parser
A simple, strongly typed .NET C# command line parser library using a fluent easy to use interface -
CsConsoleFormat
.NET C# library for advanced formatting of console output [Apache] -
EntryPoint
Composable CLI Argument Parser for all modern .Net platforms. -
Appccelerate - Command Line Parser
A simple command line parser with fluent definition API. -
RunInfoBuilder
A unique command line parser for .NET that utilizes object trees for commands. -
Sitemap Tools
A sitemap (sitemap.xml) querying and parsing library for .NET -
Robots Exclusion Tools
A "robots.txt" parsing and querying library for .NET -
Tamar.ANSITerm
“ANSITerm” provides ANSI escape codes and true color formatting for .NET Core's Console on Linux terminals. -
DarkXaHTeP.CommandLine
Allows creating CommandLine applications using Microsoft.Extensions.CommandLineUtils together with DI, Configuration and Logging in a convenient way similar to AspNetCore Hosting
Collect and Analyze Billions of Data Points in Real Time
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of NFlags or a related project?
README
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
- Install NFLags from NuGet.
- Start new console project.
- Configure NFLags:
c# 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](https://bartoszgolek.github.io/NFlags/)
*Note that all licence references and agreements mentioned in the NFlags README section above
are relevant to that project's source code only.