Upstream Tyrrrz/CliFx state of the touched files before 72b7d869fc

This commit is contained in:
upstream committed 2026-08-28 10:12:58 +02:00
1 parent 8f11b8ff38
commit 50964082ba
6 files changed
+3 -132

No files matched your search

-10
View File
@@ -29,14 +29,4 @@ public class CommandAttribute(string? name) : Attribute
/// Used for display purposes in the help text.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Usage examples of the command.
/// Used for display purposes in the help text.
/// </summary>
/// <remarks>
/// Each example contains only what comes after the command name; the name itself
/// is prepended when the help text is rendered.
/// </remarks>
public string[] Examples { get; set; } = [];
}
+2 -10
View File
@@ -13,7 +13,6 @@ public class CommandDescriptor(
Type type,
string? name,
string? description,
IReadOnlyList<string> examples,
IReadOnlyList<CommandInputDescriptor> inputs
)
{
@@ -31,9 +30,6 @@ public class CommandDescriptor(
/// <inheritdoc cref="CommandAttribute.Description" />
public string? Description { get; } = description;
/// <inheritdoc cref="CommandAttribute.Examples" />
public IReadOnlyList<string> Examples { get; } = examples;
/// <summary>
/// Inputs (parameters and options) of the command;
/// </summary>
@@ -61,10 +57,6 @@ public class CommandDescriptor(
public class CommandDescriptor<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
TCommand
>(
string? name,
string? description,
IReadOnlyList<string> examples,
IReadOnlyList<CommandInputDescriptor> inputs
) : CommandDescriptor(typeof(TCommand), name, description, examples, inputs)
>(string? name, string? description, IReadOnlyList<CommandInputDescriptor> inputs)
: CommandDescriptor(typeof(TCommand), name, description, inputs)
where TCommand : ICommand;
-13
View File
@@ -73,19 +73,6 @@ internal class HelpWriter(HelpContext context, ConsoleWriter consoleWriter)
WriteLine();
}
// Examples
foreach (var example in context.Command.Examples)
{
WriteHorizontalMargin();
WriteCommandInvocation();
Write(' ');
Write(example);
WriteLine();
}
// Child commands
if (context.Root.GetChildCommands(context.Command.Name).Any())
{