using System; namespace CliFx.Binding; /// /// Binds a type to a command. /// [AttributeUsage(AttributeTargets.Class, Inherited = false)] public class CommandAttribute(string? name) : Attribute { /// /// Initializes an instance of . /// public CommandAttribute() : this(null) { } /// /// Command name. /// /// /// Command can have no name, in which case it's treated as the application's default (i.e., root) command. /// Only one default command is allowed to be registered in an application. /// All commands registered in an application must have unique names (comparison IS NOT case-sensitive). /// public string? Name { get; } = name; /// /// Command description. /// Used for display purposes in the help text. /// public string? Description { get; set; } /// /// Usage examples of the command. /// Used for display purposes in the help text. /// /// /// Each example contains only what comes after the command name; the name itself /// is prepended when the help text is rendered. /// public string[] Examples { get; set; } = []; }