namespace Spectre.Console.Cli; /// /// Represents a command context. /// public sealed class CommandContext { /// /// Gets the remaining arguments. /// /// /// The remaining arguments. /// public IRemainingArguments Remaining { get; } /// /// Gets the name of the command. /// /// /// The name of the command. /// public string Name { get; } /// /// Gets the data that was passed to the command during registration (if any). /// /// /// The command data. /// public object? Data { get; } /// /// Initializes a new instance of the class. /// /// The remaining arguments. /// The command name. /// The command data. public CommandContext(IRemainingArguments remaining, string name, object? data) { Remaining = remaining ?? throw new System.ArgumentNullException(nameof(remaining)); Name = name ?? throw new System.ArgumentNullException(nameof(name)); Data = data; } }