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(CommandRunnerContext, ITerminalHelpProvider, ILogger?)
Delegates to RunHelpAsync(CommandRunnerContext) asynchronously.
public Task<CommandRunnerResult> DelegateHelpAsync(CommandRunnerContext context, ITerminalHelpProvider helpProvider, ILogger? logger = null)
Parameters
context
CommandRunnerContextThe runner context.
helpProvider
ITerminalHelpProviderThe help provider.
logger
ILoggerThe logger.
Returns
- Task<CommandRunnerResult>
The runner result.
DelegateRunAsync(CommandRunnerContext, ILogger?)
Delegates to RunCommandAsync(CommandRunnerContext) asynchronously.
public Task<CommandRunnerResult> DelegateRunAsync(CommandRunnerContext context, ILogger? logger = null)
Parameters
context
CommandRunnerContextThe runner context.
logger
ILoggerThe logger.
Returns
- Task<CommandRunnerResult>
The runner result.
RunCommandAsync(CommandRunnerContext)
Runs a command asynchronously.
public abstract Task<TResult> RunCommandAsync(CommandRunnerContext context)
Parameters
context
CommandRunnerContextThe runner context.
Returns
- Task<TResult>
The runner result.
RunHelpAsync(CommandRunnerContext)
Runs the command help asynchronously.
public virtual Task RunHelpAsync(CommandRunnerContext context)
Parameters
context
CommandRunnerContextThe command context.