mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-17 17:32:50 +08:00
23 lines
765 B
C#
23 lines
765 B
C#
namespace Spectre.Console.Cli;
|
|
|
|
/// <summary>
|
|
/// Represents a command.
|
|
/// </summary>
|
|
public interface ICommand
|
|
{
|
|
/// <summary>
|
|
/// Validates the specified settings and remaining arguments.
|
|
/// </summary>
|
|
/// <param name="context">The command context.</param>
|
|
/// <param name="settings">The settings.</param>
|
|
/// <returns>The validation result.</returns>
|
|
ValidationResult Validate(CommandContext context, CommandSettings settings);
|
|
|
|
/// <summary>
|
|
/// Executes the command.
|
|
/// </summary>
|
|
/// <param name="context">The command context.</param>
|
|
/// <param name="settings">The settings.</param>
|
|
/// <returns>The validation result.</returns>
|
|
Task<int> Execute(CommandContext context, CommandSettings settings);
|
|
} |