ParseResult.GetValue Method
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
| GetValue<T>(Argument<T>) |
Gets the parsed or default value for the specified argument. |
| GetValue<T>(Option<T>) |
Gets the parsed or default value for the specified option. |
| GetValue<T>(String) |
Gets the parsed or default value for the specified symbol name, in the context of parsed command (not entire symbol tree). |
GetValue<T>(Argument<T>)
- Source:
- ParseResult.cs
Gets the parsed or default value for the specified argument.
public:
generic <typename T>
T GetValue(System::CommandLine::Argument<T> ^ argument);
public T? GetValue<T>(System.CommandLine.Argument<T> argument);
member this.GetValue : System.CommandLine.Argument<'T> -> 'T
Public Function GetValue(Of T) (argument As Argument(Of T)) As T
Type Parameters
- T
Parameters
- argument
- Argument<T>
The argument for which to get a value.
Returns
The parsed value or a configured default.
Applies to
GetValue<T>(Option<T>)
- Source:
- ParseResult.cs
Gets the parsed or default value for the specified option.
public:
generic <typename T>
T GetValue(System::CommandLine::Option<T> ^ option);
public T? GetValue<T>(System.CommandLine.Option<T> option);
member this.GetValue : System.CommandLine.Option<'T> -> 'T
Public Function GetValue(Of T) (option As Option(Of T)) As T
Type Parameters
- T
Parameters
- option
- Option<T>
The option for which to get a value.
Returns
The parsed value or a configured default.
Applies to
GetValue<T>(String)
- Source:
- ParseResult.cs
Gets the parsed or default value for the specified symbol name, in the context of parsed command (not entire symbol tree).
public:
generic <typename T>
T GetValue(System::String ^ name);
public T? GetValue<T>(string name);
member this.GetValue : string -> 'T
Public Function GetValue(Of T) (name As String) As T
Type Parameters
- T
Parameters
- name
- String
The name of the Symbol for which to get a value.
Returns
The parsed value or a configured default.
Exceptions
Thrown when parsing resulted in parse error(s).
Thrown when there was no symbol defined for given name for the parsed command.
Thrown when parsed result can not be cast to T.