System.CommandLine v2.0.0-beta1.20371.2
Pre-releaseWhat's new
- Moved the documentation from the wiki into the repository so people can make pull requests.
System.CommandLine
-
Added support for setting environment variables using the
[env:name=value]
directive. (#965) Thanks, @fredrikhr! -
Made constructors more consistent between
Argument<T>
andOption<T>
to allow specifyinggetDefaultValue
anddescription
. -
Added
ParseResult.ValueForArgument<T>(Argument<T>)
andParseResult.ValueForOption<T>(Option<T>)
to combine lookup and conversion into a single method supporting type inference. (#949) -
Added default values to help output. (#898) Thanks, @NikiforovAll!
-
Help now wraps lines for long option names (#947) Thanks, @apogeeoak!
-
Added
SymbolResult.FindResultFor
to provide a cleaner way to find the result for a particularCommand
,Option
, orArgument
. This is similar toParseResult.FindResultFor
but it can be used within a custom parse delegate (ParseArgument<T>
) so that you don't have to traverse the result tree. -
Improved suggestion APIs to allow replacing the default suggestions, using
Argument.Suggestions.Clear()
. (#955) Thanks, @jmarolf! -
Added
Option.AddSuggestions
andArgument.AddSuggestions
methods with overloads to provide a static list of suggestions or a delegate for more dynamic suggestions. -
Suggestions are now sorted so that the matches closest to what was typed are shown first. (#891) Thanks, @kimsey0!
-
Performance improvements in tokenizer and symbol result lookups.
System.CommandLine.Rendering
Breaking changes
-
Renamed
Option.Required
toOption.IsRequired
. -
Renamed the delegate type
Suggest
toSuggestDelegate
. -
Symbol.Aliases
andSymbol.RawAliases
are now of typeIReadOnlyCollection<string>
rather thanIReadOnlyList<string>
.