ICommandApp

Represents a command line application.

Represents a command line application.

Methods

public void Configure(Action<IConfigurator> configuration)

Configures the command line application.

Parameters:

configuration (Action<IConfigurator>)
The configuration.
public int Run(IEnumerable<string> args, CancellationToken cancellationToken = default)

Runs the command line application with specified arguments.

Parameters:

args (IEnumerable<string>)
The arguments.
cancellationToken (CancellationToken)
A CancellationToken that can be used to abort the application.

Returns:

The exit code from the executed command.

public Task<int> RunAsync(IEnumerable<string> args, CancellationToken cancellationToken = default)

Runs the command line application with specified arguments.

Parameters:

args (IEnumerable<string>)
The arguments.
cancellationToken (CancellationToken)
A CancellationToken that can be used to abort the application.

Returns:

The exit code from the executed command.