Sort commands also in the "subcommands" section

This commit is contained in:
Tyrrrz
2023-04-06 12:27:11 +03:00
parent bf7f607f9b
commit 456099591a

View File

@@ -368,7 +368,8 @@ internal class HelpConsoleFormatter : ConsoleFormatter
var childCommandSchemas = _context var childCommandSchemas = _context
.ApplicationSchema .ApplicationSchema
.GetChildCommands(_context.CommandSchema.Name) .GetChildCommands(_context.CommandSchema.Name)
.OrderBy(a => a.Name, StringComparer.Ordinal); .OrderBy(a => a.Name, StringComparer.Ordinal)
.ToArray();
if (!childCommandSchemas.Any()) if (!childCommandSchemas.Any())
return; return;
@@ -403,7 +404,9 @@ internal class HelpConsoleFormatter : ConsoleFormatter
// Child commands of child command // Child commands of child command
var grandChildCommandSchemas = _context var grandChildCommandSchemas = _context
.ApplicationSchema .ApplicationSchema
.GetChildCommands(childCommandSchema.Name); .GetChildCommands(childCommandSchema.Name)
.OrderBy(c => c.Name, StringComparer.Ordinal)
.ToArray();
if (grandChildCommandSchemas.Any()) if (grandChildCommandSchemas.Any())
{ {