Table of Contents

Class CommandRunner<TResult>

Namespace
OneImlx.Terminal.Commands.Runners
Assembly
OneImlx.Terminal.dll

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
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 CommandContext

The runner context.

helpProvider ITerminalHelpProvider

The help provider.

logger ILogger

The 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 CommandContext

The runner context.

logger ILogger

The logger.

Returns

Task<CommandRunnerResult>

The runner result.

RunCommandAsync(CommandContext)

Runs a command asynchronously.

public abstract Task<TResult> RunCommandAsync(CommandContext context)

Parameters

context CommandContext

The runner context.

Returns

Task<TResult>

The runner result.

RunHelpAsync(CommandContext)

Runs a command help asynchronously.

public virtual Task RunHelpAsync(CommandContext context)

Parameters

context CommandContext

The runner context.

Returns

Task

The runner result.