From 535f085d6b9ab257eb17aa82a53d890f2e027d70 Mon Sep 17 00:00:00 2001 From: dualfroz Date: Wed, 23 Sep 2026 06:17:56 +0200 Subject: [PATCH] Keep the pre-Examples descriptor constructors as forwarding overloads --- CliFx/Binding/CommandDescriptor.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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) { } +}