แก้ไข

แชร์ผ่าน


CommandLineConfiguration Constructors

Definition

Overloads

CommandLineConfiguration(Command, Boolean, Boolean, Boolean, LocalizationResources, ResponseFileHandling, IReadOnlyList<InvocationMiddleware>, Func<BindingContext, HelpBuilder>)

Initializes a new instance of the CommandLineConfiguration class.

CommandLineConfiguration(Command, Boolean, Boolean, Boolean, Boolean, LocalizationResources, IReadOnlyList<InvocationMiddleware>, Func<BindingContext, HelpBuilder>, TryReplaceToken)

CommandLineConfiguration(Command, Boolean, Boolean, Boolean, LocalizationResources, ResponseFileHandling, IReadOnlyList<InvocationMiddleware>, Func<BindingContext, HelpBuilder>)

Initializes a new instance of the CommandLineConfiguration class.

public CommandLineConfiguration(System.CommandLine.Command command, bool enablePosixBundling = true, bool enableDirectives = true, bool enableLegacyDoubleDashBehavior = false, System.CommandLine.LocalizationResources? resources = default, System.CommandLine.Parsing.ResponseFileHandling responseFileHandling = System.CommandLine.Parsing.ResponseFileHandling.ParseArgsAsLineSeparated, System.Collections.Generic.IReadOnlyList<System.CommandLine.Invocation.InvocationMiddleware>? middlewarePipeline = default, Func<System.CommandLine.Binding.BindingContext,System.CommandLine.Help.HelpBuilder>? helpBuilderFactory = default);
new System.CommandLine.CommandLineConfiguration : System.CommandLine.Command * bool * bool * bool * System.CommandLine.LocalizationResources * System.CommandLine.Parsing.ResponseFileHandling * System.Collections.Generic.IReadOnlyList<System.CommandLine.Invocation.InvocationMiddleware> * Func<System.CommandLine.Binding.BindingContext, System.CommandLine.Help.HelpBuilder> -> 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 resources As LocalizationResources = Nothing, Optional responseFileHandling As ResponseFileHandling = System.CommandLine.Parsing.ResponseFileHandling.ParseArgsAsLineSeparated, Optional middlewarePipeline As IReadOnlyList(Of InvocationMiddleware) = Nothing, Optional helpBuilderFactory As Func(Of BindingContext, HelpBuilder) = 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.

resources
LocalizationResources

Provide custom validation messages.

responseFileHandling
ResponseFileHandling

One of the enumeration values that specifies how response files (.rsp) are handled.

middlewarePipeline
IReadOnlyList<InvocationMiddleware>

Provide a custom middleware pipeline.

helpBuilderFactory
Func<BindingContext,HelpBuilder>

Provide a custom help builder.

Applies to

CommandLineConfiguration(Command, Boolean, Boolean, Boolean, Boolean, LocalizationResources, IReadOnlyList<InvocationMiddleware>, Func<BindingContext, HelpBuilder>, TryReplaceToken)

Source:
CommandLineConfiguration.cs
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
enablePosixBundling
Boolean
enableDirectives
Boolean
enableLegacyDoubleDashBehavior
Boolean
enableTokenReplacement
Boolean
middlewarePipeline
IReadOnlyList<InvocationMiddleware>
helpBuilderFactory
Func<BindingContext,HelpBuilder>
tokenReplacer
TryReplaceToken

Applies to