Option<T> Constructors
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.
Overloads
Option<T>(String, String) |
Initializes a new instance of the IdentifierSymbol class. |
Option<T>(String[], String) |
Initializes a new instance of the Option<T> class. |
Option<T>(String, Func<T>, String) |
Initializes a new instance of the Option<T> class. |
Option<T>(String[], Func<T>, String) |
Initializes a new instance of the Option<T> class. |
Option<T>(String, ParseArgument<T>, Boolean, String) |
Initializes a new instance of the Option<T> class. |
Option<T>(String[], ParseArgument<T>, Boolean, String) |
Initializes a new instance of the Option<T> class. |
Option<T>(String, String)
Initializes a new instance of the IdentifierSymbol class.
public Option (string name, string? description = default);
new System.CommandLine.Option<'T> : string * string -> System.CommandLine.Option<'T>
Public Sub New (name As String, Optional description As String = Nothing)
Parameters
- name
- String
The name of the symbol.
- description
- String
The description of the symbol, which is displayed in command line help.
Applies to
Option<T>(String[], String)
Initializes a new instance of the Option<T> class.
public Option (string[] aliases, string? description = default);
new System.CommandLine.Option<'T> : string[] * string -> System.CommandLine.Option<'T>
Public Sub New (aliases As String(), Optional description As String = Nothing)
Parameters
- aliases
- String[]
The set of strings that can be used on the command line to specify the option.
- description
- String
The description of the option shown in help.
Applies to
Option<T>(String, Func<T>, String)
Initializes a new instance of the Option<T> class.
public Option (string name, Func<T> getDefaultValue, string? description = default);
new System.CommandLine.Option<'T> : string * Func<'T> * string -> System.CommandLine.Option<'T>
Public Sub New (name As String, getDefaultValue As Func(Of T), Optional description As String = Nothing)
Parameters
- name
- String
The name of the option, which can be used to specify it on the command line.
- getDefaultValue
- Func<T>
A delegate used to get a default value for the option when it is not specified on the command line.
- description
- String
The description of the option shown in help.
Applies to
Option<T>(String[], Func<T>, String)
Initializes a new instance of the Option<T> class.
public Option (string[] aliases, Func<T> getDefaultValue, string? description = default);
new System.CommandLine.Option<'T> : string[] * Func<'T> * string -> System.CommandLine.Option<'T>
Public Sub New (aliases As String(), getDefaultValue As Func(Of T), Optional description As String = Nothing)
Parameters
- aliases
- String[]
The set of strings that can be used on the command line to specify the option.
- getDefaultValue
- Func<T>
A delegate used to get a default value for the option when it is not specified on the command line.
- description
- String
The description of the option shown in help.
Applies to
Option<T>(String, ParseArgument<T>, Boolean, String)
Initializes a new instance of the Option<T> class.
public Option (string name, System.CommandLine.Parsing.ParseArgument<T> parseArgument, bool isDefault = false, string? description = default);
new System.CommandLine.Option<'T> : string * System.CommandLine.Parsing.ParseArgument<'T> * bool * string -> System.CommandLine.Option<'T>
Public Sub New (name As String, parseArgument As ParseArgument(Of T), Optional isDefault As Boolean = false, Optional description As String = Nothing)
Parameters
- name
- String
- parseArgument
- ParseArgument<T>
- isDefault
- Boolean
- description
- String
Applies to
Option<T>(String[], ParseArgument<T>, Boolean, String)
Initializes a new instance of the Option<T> class.
public Option (string[] aliases, System.CommandLine.Parsing.ParseArgument<T> parseArgument, bool isDefault = false, string? description = default);
new System.CommandLine.Option<'T> : string[] * System.CommandLine.Parsing.ParseArgument<'T> * bool * string -> System.CommandLine.Option<'T>
Public Sub New (aliases As String(), parseArgument As ParseArgument(Of T), Optional isDefault As Boolean = false, Optional description As String = Nothing)
Parameters
- aliases
- String[]
- parseArgument
- ParseArgument<T>
- isDefault
- Boolean
- description
- String