CliRunTDefinition(String, CliSettings) Method

Parses a command line string array and runs the handler for the indicated command.

Definition

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

Parameters

args  String  (Optional)

[Missing <param name="args"/> documentation for "M:DotMake.CommandLine.Cli.Run``1(System.String[],DotMake.CommandLine.CliSettings)"]

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

Int32
The exit code for the invocation.

Example

C#
//In Program.cs, add this single line:
Cli.Run<RootCliCommand>(args);
C#
//In Program.cs, add this single line for returning exit code:
return Cli.Run<RootCliCommand>(args);

See Also