共用方式為


CommandLineConfiguration 建構函式

定義

初始化 CommandLineConfiguration 類別的新實例。

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)

參數

command
Command

剖析器的根命令。

enablePosixBundling
Boolean

true 表示啟用 POSIX 統合;否則為 false

enableDirectives
Boolean

true 表示啟用指示詞剖析;否則為 false

enableLegacyDoubleDashBehavior
Boolean

啟用令牌的 -- 舊版行為,也就是忽略後續令牌的剖析,並將其放在 UnparsedTokens 清單中。

resources
LocalizationResources

提供自訂驗證訊息。

responseFileHandling
ResponseFileHandling

其中一個列舉值,指定如何處理響應檔 (.rsp) 。

middlewarePipeline
IReadOnlyList<InvocationMiddleware>

提供自訂中間件管線。

helpBuilderFactory
Func<BindingContext,HelpBuilder>

提供自定義說明產生器。

適用於