CliParseTDefinition(String, CliSettings) Method
Parses a command line string and returns the parse result for the indicated command.
Namespace: DotMake.CommandLineAssembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 2.6.8
public static CliResult Parse<TDefinition>(
string commandLine,
CliSettings settings = null
)
- commandLine String
- 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.
CliResult
A
CliResult providing details about the parse operation and methods for binding.
//If you need to examine the parse result, such as errors:
var result = Cli.Parse<RootCliCommand>("NewValueForArgument1 --option-1 NewValueForOption1");
if (result.ParseResult.Errors.Count > 0)
{
}