CommandLineConfiguration 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 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>
提供自定义帮助生成器。