McMaster.Extensions.CommandLineUtils 2.1.0-rc

Command-line parsing API. A community-maintained fork of Microsoft.Extensions.CommandLineUtils, plus extras.
Commonly used types:


This is a prerelease version of McMaster.Extensions.CommandLineUtils.
There is a newer version of this package available.
See the version list below for details.
Install-Package McMaster.Extensions.CommandLineUtils -Version 2.1.0-rc
dotnet add package McMaster.Extensions.CommandLineUtils --version 2.1.0-rc
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.1.0-rc" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add McMaster.Extensions.CommandLineUtils --version 2.1.0-rc
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

New features:
- Attributes. Simplify command line argument definitions by adding attributes to a class that represents options and arguments.
   - Options defined as [Option] or [Argument], [Subcommand].
   - Command parsing options can be defined with [Command] and [Subcmomand].
   - Special options include [HelpOption] and [VersionOption].
   - Validation. You can use [Required] and any other ValidationAttribute to validate input on options and arguments.
- Async from end to end. Using C# 7.1 and attribute binding, your console app can be async from top to bottom.
- Required options and arguments. Added CommandOption.IsRequired() and CommandArgument.IsRequired().

- Prompt.GetYesNo, Prompt.GetPassword, and more. Added API for interactively getting responses on the console.
- Added OptionAttribute, ArgumentAttribute, CommandAttribute, SubcommandAttribute, HelpOptionAttribute, and VersionOptionAttribute.
- CommandLineApplication.Execute<TApp>() - executes an app where TApp uses attributes to define its options
- CommandLineApplication.ExecuteAsync<TApp>() - sample thing, but async.
- CommandLineApplication.ResponseFileHandling - the parser can treat arguments that begin with '@' as response files.
  Response files contain arguments that will be treated as if they were passed on command line.

Minor bug fixes:
- Add return types to .VerboseOption() and ensure .HasValue() is true when HelpOption or VerboseOption are matched
- Fix a NullReferenceException in some edge cases when parsing args
- Fix bug where DotNetExe.FullPath might return the wrong location of the dotnet.exe file

Showing the top 10 GitHub repositories that depend on McMaster.Extensions.CommandLineUtils:

Repository Stars
.NET Decompiler
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
Powerful .NET library for benchmarking
ACID Document Database
xunit/xunit is a free, open source, community-focused unit testing tool for the .NET Framework.
Write C# apps with a text editor, nuget and the power of Roslyn!
Fluent migrations framework for .NET
CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
Microsoft Azure SDK for .NET
Cross platform code coverage for .NET

Version History

Version Downloads Last updated
2.4.2 8,526 9/24/2019
2.4.1 3,894 9/18/2019
2.4.0 2,113 9/14/2019
2.3.4 123,394 4/11/2019
2.3.3 44,910 3/11/2019
2.3.2 64,557 2/5/2019
2.3.1 18,654 1/19/2019
2.3.0 54,062 1/1/2019
2.2.5 236,688 7/2/2018
2.2.4 42,615 5/25/2018
2.2.3 19,230 5/11/2018
2.2.2 24,071 4/28/2018
2.2.1 9,964 4/11/2018
2.2.0 117,121 3/31/2018
2.2.0-rc 826 3/23/2018
2.2.0-beta 564 3/8/2018
2.2.0-alpha 536 2/20/2018
2.1.1 58,475 12/28/2017
2.1.0 2,055 12/13/2017
2.1.0-rc 511 12/7/2017
2.1.0-beta 1,474 11/22/2017
2.1.0-alpha 422 11/11/2017
2.0.1 5,758 10/13/2017
2.0.0 4,686 9/16/2017
Show less