CliBindingContext.GetValue Method
Definition
- Namespace
- DotMake.CommandLine
- Assembly
- DotMake.CommandLine.dll
GetValue<T>(ParseResult, Directive)
Gets the parsed or default value for the specified directive.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public T GetValue<T>(ParseResult parseResult, Directive directive)
Parameters
parseResultParseResultThe parse result.
directiveDirectiveThe directive for which to get a value.
Returns
- T
The parsed value or a configured default.
Type Parameters
TThe option type.
GetValue(ParseResult, Directive)
Gets the parsed or default value for the specified directive.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public object GetValue(ParseResult parseResult, Directive directive)
Parameters
parseResultParseResultThe parse result.
directiveDirectiveThe directive for which to get a value.
Returns
- object
The parsed value or a configured default.
GetValue<T>(ParseResult, Option<T>)
Gets the parsed or default value for the specified option.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public T GetValue<T>(ParseResult parseResult, Option<T> option)
Parameters
parseResultParseResultThe parse result.
optionOption<T>The option for which to get a value.
Returns
- T
The parsed value or a configured default.
Type Parameters
TThe option type.
GetValue(ParseResult, Option)
Gets the parsed or default value for the specified option.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public object GetValue(ParseResult parseResult, Option option)
Parameters
parseResultParseResultThe parse result.
optionOptionThe option for which to get a value.
Returns
- object
The parsed value or a configured default.
GetValue<T>(ParseResult, Argument<T>)
Gets the parsed or default value for the specified argument.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public T GetValue<T>(ParseResult parseResult, Argument<T> argument)
Parameters
parseResultParseResultThe parse result.
argumentArgument<T>The argument for which to get a value.
Returns
- T
The parsed value or a configured default.
Type Parameters
TThe argument type.
GetValue(ParseResult, Argument)
Gets the parsed or default value for the specified argument.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types.
public object GetValue(ParseResult parseResult, Argument argument)
Parameters
parseResultParseResultThe parse result.
argumentArgumentThe argument for which to get a value.
Returns
- object
The parsed value or a configured default.