CliRunTDefinition(String, CliSettings) Method
Parses a command line string value and runs the handler for the indicated command.
Namespace: DotMake.CommandLineAssembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 2.6.8
public static int Run<TDefinition>(
string commandLine,
CliSettings settings = null
)
- commandLine String
[Missing <param name="commandLine"/> 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.
- TDefinition
-
The definition class for the command. A command builder for this class should be automatically generated by the source generator.
Int32
The exit code for the invocation.
//In Program.cs, add this single line:
Cli.Run<RootCliCommand>("NewValueForArgument1 --option-1 NewValueForOption1");
//In Program.cs, add this single line for returning exit code:
return Cli.Run<RootCliCommand>("NewValueForArgument1 --option-1 NewValueForOption1");