McMaster.Extensions.CommandLineUtils 2.1.0

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

McMaster.Extensions.CommandLineUtils.CommandLineApplication
McMaster.Extensions.CommandLineUtils.CommandOption
McMaster.Extensions.CommandLineUtils.IConsole
McMaster.Extensions.CommandLineUtils.ArgumentEscaper

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
dotnet add package McMaster.Extensions.CommandLineUtils --version 2.1.0
paket add McMaster.Extensions.CommandLineUtils --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

See https://natemcmaster.github.io/CommandLineUtils for docs, samples, and usage.

See https://natemcmaster.github.io/CommandLineUtils for docs, samples, and usage.

Release Notes

2.1.0:
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().

New API
- 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

Version History

Version Downloads Last updated
2.3.2 2,672 2/5/2019
2.3.1 4,692 1/19/2019
2.3.0 13,980 1/1/2019
2.3.0-rc.460 214 12/15/2018
2.3.0-beta 538 12/4/2018
2.3.0-alpha 1,142 10/3/2018
2.2.5 123,580 7/2/2018
2.2.4 26,060 5/25/2018
2.2.3 15,056 5/11/2018
2.2.2 7,942 4/28/2018
2.2.1 7,717 4/11/2018
2.2.0 69,037 3/31/2018
2.2.0-rc 732 3/23/2018
2.2.0-beta 451 3/8/2018
2.2.0-alpha 436 2/20/2018
2.1.1 35,105 12/28/2017
2.1.0 1,455 12/13/2017
2.1.0-rc 405 12/7/2017
2.1.0-beta 1,046 11/22/2017
2.1.0-alpha 298 11/11/2017
2.0.1 4,730 10/13/2017
2.0.0 3,273 9/16/2017
Show less