CommandLineConfiguration Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the CommandLineConfiguration class.
public CommandLineConfiguration(System.CommandLine.Command command, bool enablePosixBundling = true, bool enableDirectives = true, bool enableLegacyDoubleDashBehavior = false, bool enableTokenReplacement = true, System.CommandLine.LocalizationResources? resources = default, System.Collections.Generic.IReadOnlyList<System.CommandLine.Invocation.InvocationMiddleware>? middlewarePipeline = default, Func<System.CommandLine.Binding.BindingContext,System.CommandLine.Help.HelpBuilder>? helpBuilderFactory = default, System.CommandLine.Parsing.TryReplaceToken? tokenReplacer = default);
new System.CommandLine.CommandLineConfiguration : System.CommandLine.Command * bool * bool * bool * bool * System.CommandLine.LocalizationResources * System.Collections.Generic.IReadOnlyList<System.CommandLine.Invocation.InvocationMiddleware> * Func<System.CommandLine.Binding.BindingContext, System.CommandLine.Help.HelpBuilder> * System.CommandLine.Parsing.TryReplaceToken -> System.CommandLine.CommandLineConfiguration
Public Sub New (command As Command, Optional enablePosixBundling As Boolean = true, Optional enableDirectives As Boolean = true, Optional enableLegacyDoubleDashBehavior As Boolean = false, Optional enableTokenReplacement As Boolean = true, Optional resources As LocalizationResources = Nothing, Optional middlewarePipeline As IReadOnlyList(Of InvocationMiddleware) = Nothing, Optional helpBuilderFactory As Func(Of BindingContext, HelpBuilder) = Nothing, Optional tokenReplacer As TryReplaceToken = Nothing)
Parameters
- command
- Command
The root command for the parser.
- enablePosixBundling
- Boolean
true
to enable POSIX bundling; otherwise, false
.
- enableDirectives
- Boolean
true
to enable directive parsing; otherwise, false
.
- enableLegacyDoubleDashBehavior
- Boolean
Enables the legacy behavior of the --
token, which is to ignore parsing of subsequent tokens and place them in the UnparsedTokens list.
- enableTokenReplacement
- Boolean
true
to enable token replacement; otherwise, false
.
- resources
- LocalizationResources
Provide custom validation messages.
- middlewarePipeline
- IReadOnlyList<InvocationMiddleware>
Provide a custom middleware pipeline.
- helpBuilderFactory
- Func<BindingContext,HelpBuilder>
Provide a custom help builder.
- tokenReplacer
- TryReplaceToken
Replaces the specified token with any number of other tokens.