diff --git a/CliFx/Binding/CommandDescriptor.cs b/CliFx/Binding/CommandDescriptor.cs index 64c81b6..425595e 100644 --- a/CliFx/Binding/CommandDescriptor.cs +++ b/CliFx/Binding/CommandDescriptor.cs @@ -50,6 +50,18 @@ public class CommandDescriptor( ? string.Equals(name, Name, StringComparison.OrdinalIgnoreCase) : string.IsNullOrWhiteSpace(name); + /// + /// Initializes an instance of without examples. + /// + public CommandDescriptor( + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] + Type type, + string? name, + string? description, + IReadOnlyList inputs + ) + : this(type, name, description, Array.Empty(), inputs) { } + /// public override string ToString() => !string.IsNullOrWhiteSpace(Name) ? Name : ""; } @@ -67,4 +79,15 @@ public class CommandDescriptor< IReadOnlyList examples, IReadOnlyList inputs ) : CommandDescriptor(typeof(TCommand), name, description, examples, inputs) - where TCommand : ICommand; + where TCommand : ICommand +{ + /// + /// Initializes an instance of without examples. + /// + public CommandDescriptor( + string? name, + string? description, + IReadOnlyList inputs + ) + : this(name, description, Array.Empty(), inputs) { } +}