namespace VpSharp.Commands.Attributes; /// /// Defines the name of a command. /// [AttributeUsage(AttributeTargets.Method)] public sealed class CommandAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// The command name. /// is . /// is empty, or consists of only whitespace. public CommandAttribute(string name) { if (name is null) { throw new ArgumentNullException(nameof(name)); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("Name cannot be empty"); } Name = name; } /// /// Gets the command name. /// /// The command name. public string Name { get; } }