CliParseTDefinition(String, CliSettings) Method

Parses a command line string array and returns the parse result for the indicated command.

Definition

Namespace: DotMake.CommandLine
Assembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 2.6.6
C#
public static CliResult Parse<TDefinition>(
	string[] args = null,
	CliSettings settings = null
)

Parameters

args  String  (Optional)
settings  CliSettings  (Optional)
The settings for the parser's grammar and behaviors.

Type Parameters

TDefinition
The definition class for the command. A command builder for this class should be automatically generated by the source generator.

Return Value

CliResult
A CliResult providing details about the parse operation and methods for binding.

Example

C#
//If you need to examine the parse result, such as errors:
var result = Cli.Parse<RootCliCommand>(args);
if (result.ParseResult.Errors.Count > 0)
{

}

See Also