mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2026-01-01 16:59:37 +01:00
Also raise CA2016 (forward the CancellationToken parameter to methods that take one) to warning Fixes #701
18 lines
765 B
C#
18 lines
765 B
C#
namespace Spectre.Console.Cli;
|
|
|
|
/// <summary>
|
|
/// Represents a command.
|
|
/// </summary>
|
|
/// <typeparam name="TSettings">The settings type.</typeparam>
|
|
public interface ICommand<TSettings> : ICommandLimiter<TSettings>
|
|
where TSettings : CommandSettings
|
|
{
|
|
/// <summary>
|
|
/// Executes the command.
|
|
/// </summary>
|
|
/// <param name="context">The command context.</param>
|
|
/// <param name="settings">The settings.</param>
|
|
/// <param name="cancellationToken">A <see cref="CancellationToken"/> that can be used to abort the command.</param>
|
|
/// <returns>An integer indicating whether or not the command executed successfully.</returns>
|
|
Task<int> ExecuteAsync(CommandContext context, TSettings settings, CancellationToken cancellationToken);
|
|
} |