mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-04 03:38:16 +08:00
eg. [CommandOption("-a|--args")] [Description(nameof(Str.GitArgs))] [Localization(typeof(Str))] public string Args { get; set; }
23 lines
770 B
C#
23 lines
770 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> ExecuteAsync(CommandContext context, CommandSettings settings);
|
|
} |