Option 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Option(String, String, Type, Func<Object>, ArgumentArity) |
初始化 Option 类的新实例。 |
Option(String[], String, Type, Func<Object>, ArgumentArity) |
初始化 Option 类的新实例。 |
Option(String, String, Type, Func<Object>, ArgumentArity)
初始化 Option 类的新实例。
public Option (string name, string? description = default, Type? argumentType = default, Func<object?>? getDefaultValue = default, System.CommandLine.ArgumentArity arity = default);
new System.CommandLine.Option : string * string * Type * Func<obj> * System.CommandLine.ArgumentArity -> System.CommandLine.Option
Public Sub New (name As String, Optional description As String = Nothing, Optional argumentType As Type = Nothing, Optional getDefaultValue As Func(Of Object) = Nothing, Optional arity As ArgumentArity = Nothing)
参数
- name
- String
选项的名称,可用于在命令行上指定它。
- description
- String
帮助中显示的选项的说明。
- argumentType
- Type
选项的参数 () 可以分析到的类型。
- arity
- ArgumentArity
选项的 arity。
适用于
Option(String[], String, Type, Func<Object>, ArgumentArity)
初始化 Option 类的新实例。
public Option (string[] aliases, string? description = default, Type? argumentType = default, Func<object?>? getDefaultValue = default, System.CommandLine.ArgumentArity arity = default);
new System.CommandLine.Option : string[] * string * Type * Func<obj> * System.CommandLine.ArgumentArity -> System.CommandLine.Option
Public Sub New (aliases As String(), Optional description As String = Nothing, Optional argumentType As Type = Nothing, Optional getDefaultValue As Func(Of Object) = Nothing, Optional arity As ArgumentArity = Nothing)
参数
- aliases
- String[]
可在命令行上用于指定 选项的字符串集。
- description
- String
帮助中显示的选项的说明。
- argumentType
- Type
选项的参数 () 可以分析到的类型。
- arity
- ArgumentArity
选项的 arity。