CliCommandBuilderGetArgumentParserTArgument(FuncString, TArgument) Method

Gets an argument parser method for an argument type.

This is mainly used for adding support for binding custom types which have a public constructor or a static Parse method with a string parameter (other parameters, if any, should be optional).

Definition

Namespace: DotMake.CommandLine
Assembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 1.8.8
C#
public static Func<ArgumentResult, TArgument> GetArgumentParser<TArgument>(
	Func<string, TArgument> convertFromString = null
)

Parameters

convertFromString  FuncString, TArgument  (Optional)
A delegate which creates an instance of custom type from a string.

Type Parameters

TArgument
The argument type.

Return Value

FuncArgumentResult, TArgument
A delegate which can be passed to an option or argument.

See Also