Argument<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
| Argument<T>() |
Initializes a new instance of the Argument class. |
| Argument<T>(Func<T>) |
Initializes a new instance of the Argument class. |
| Argument<T>(String) |
Initializes a new instance of the Argument class. |
| Argument<T>(ParseArgument<T>, Boolean) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, String) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, Func<T>, String) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, ParseArgument<T>, Boolean, String) |
Initializes a new instance of the Argument class. |
Argument<T>()
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public:
Argument();
public Argument();
Public Sub New ()
Applies to
Argument<T>(Func<T>)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public:
Argument(Func<T> ^ getDefaultValue);
public Argument(Func<T> getDefaultValue);
new System.CommandLine.Argument<'T> : Func<'T> -> System.CommandLine.Argument<'T>
Public Sub New (getDefaultValue As Func(Of T))
Parameters
- getDefaultValue
- Func<T>
The delegate to invoke to return the default value.
Exceptions
Thrown when getDefaultValue is null.
Applies to
Argument<T>(String)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public:
Argument(System::String ^ name);
public Argument(string name);
new System.CommandLine.Argument<'T> : string -> System.CommandLine.Argument<'T>
Public Sub New (name As String)
Parameters
- name
- String
The name of the argument. This can be used to look up the parsed value and is displayed in help
Applies to
Argument<T>(ParseArgument<T>, Boolean)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public Argument(System.CommandLine.Parsing.ParseArgument<T> parse, bool isDefault = false);
new System.CommandLine.Argument<'T> : System.CommandLine.Parsing.ParseArgument<'T> * bool -> System.CommandLine.Argument<'T>
Public Sub New (parse As ParseArgument(Of T), Optional isDefault As Boolean = false)
Parameters
- parse
- ParseArgument<T>
A custom argument parser.
- isDefault
- Boolean
true to use the parse result as default value.
Applies to
Argument<T>(String, String)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public Argument(string? name, string? description = default);
new System.CommandLine.Argument<'T> : string * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, Optional description As String = Nothing)
Parameters
- name
- String
The name of the argument.
- description
- String
The description of the argument, shown in help.
Applies to
Argument<T>(String, Func<T>, String)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public Argument(string name, Func<T> getDefaultValue, string? description = default);
new System.CommandLine.Argument<'T> : string * Func<'T> * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, getDefaultValue As Func(Of T), Optional description As String = Nothing)
Parameters
- name
- String
The name of the argument.
- getDefaultValue
- Func<T>
The delegate to invoke to return the default value.
- description
- String
The description of the argument, shown in help.
Exceptions
Thrown when getDefaultValue is null.
Applies to
Argument<T>(String, ParseArgument<T>, Boolean, String)
- Source:
- Argument%7BT%7D.cs
Initializes a new instance of the Argument class.
public Argument(string? name, System.CommandLine.Parsing.ParseArgument<T> parse, bool isDefault = false, string? description = default);
new System.CommandLine.Argument<'T> : string * System.CommandLine.Parsing.ParseArgument<'T> * bool * string -> System.CommandLine.Argument<'T>
Public Sub New (name As String, parse As ParseArgument(Of T), Optional isDefault As Boolean = false, Optional description As String = Nothing)
Parameters
- name
- String
The name of the argument.
- parse
- ParseArgument<T>
A custom argument parser.
- isDefault
- Boolean
true to use the parse result as default value.
- description
- String
The description of the argument, shown in help.
Exceptions
Thrown when parse is null.