Cli.RunAsync<TDefinition>(String[], CliSettings, CancellationToken) Method
Parses a command line string array and runs the handler asynchronously for the indicated command.
Namespace: DotMake.CommandLineAssembly: DotMake.CommandLine (in DotMake.CommandLine.dll) Version: 2.0.0
public static Task<int> RunAsync<TDefinition>(
string[] args = null,
CliSettings settings = null,
CancellationToken cancellationToken = default
)
- args String[] (Optional)
-
The string array typically passed to a program. This is usually
the special variable args available in Program.cs (new style with top-level statements)
or the string array passed to the program's Main method (old style).
If not specified or null, args will be retrieved automatically from the current process via GetArgs().
- settings CliSettings (Optional)
-
The settings for the parser's grammar and behaviors.
- cancellationToken CancellationToken (Optional)
- The token to monitor for cancellation requests.
- TDefinition
-
The definition class for the command. A command builder for this class should be automatically generated by the source generator.
Task<Int32>
The exit code for the invocation.
await Cli.RunAsync<RootCliCommand>(args);
return await Cli.RunAsync<RootCliCommand>(args);