Class CommandRunner<TResult>
The command runner is where developers implement how commands are executed. It operates asynchronously to handle commands that might take a while to process. The framework routes each parsed command to its specific runner, helping to organize and manage the command execution logic within your application.
public abstract class CommandRunner<TResult> : IDelegateCommandRunner, ICommandRunner<TResult> where TResult : CommandRunnerResult
Type Parameters
TResult
- Inheritance
-
CommandRunner<TResult>
- Implements
-
ICommandRunner<TResult>
- Derived
- Inherited Members
Methods
DelegateHelpAsync(CommandContext, ITerminalHelpProvider, ILogger?)
Delegates to RunHelpAsync(CommandContext) asynchronously.
public Task<CommandRunnerResult> DelegateHelpAsync(CommandContext context, ITerminalHelpProvider helpProvider, ILogger? logger = null)
Parameters
context
CommandContextThe runner context.
helpProvider
ITerminalHelpProviderThe help provider.
logger
ILoggerThe logger.
Returns
- Task<CommandRunnerResult>
The runner result.
DelegateRunAsync(CommandContext, ILogger?)
Delegates to RunCommandAsync(CommandContext) asynchronously.
public Task<CommandRunnerResult> DelegateRunAsync(CommandContext context, ILogger? logger = null)
Parameters
context
CommandContextThe runner context.
logger
ILoggerThe logger.
Returns
- Task<CommandRunnerResult>
The runner result.
RunCommandAsync(CommandContext)
Runs a command asynchronously.
public abstract Task<TResult> RunCommandAsync(CommandContext context)
Parameters
context
CommandContextThe runner context.
Returns
- Task<TResult>
The runner result.
RunHelpAsync(CommandContext)
Runs a command help asynchronously.
public virtual Task RunHelpAsync(CommandContext context)
Parameters
context
CommandContextThe runner context.
Returns
- Task
The runner result.