Table of Contents

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

parseResult ParseResult

The parse result.

directive Directive

The directive for which to get a value.

Returns

T

The parsed value or a configured default.

Type Parameters

T

The 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

parseResult ParseResult

The parse result.

directive Directive

The 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

parseResult ParseResult

The parse result.

option Option<T>

The option for which to get a value.

Returns

T

The parsed value or a configured default.

Type Parameters

T

The 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

parseResult ParseResult

The parse result.

option Option

The 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

parseResult ParseResult

The parse result.

argument Argument<T>

The argument for which to get a value.

Returns

T

The parsed value or a configured default.

Type Parameters

T

The 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

parseResult ParseResult

The parse result.

argument Argument

The argument for which to get a value.

Returns

object

The parsed value or a configured default.