From ae96606ab7151e4f2c823fd93490c7745dfa6bfa Mon Sep 17 00:00:00 2001 From: Phil Scott Date: Tue, 13 Apr 2021 09:36:37 -0400 Subject: [PATCH] Adds default command to explain feature --- .../Cli/Internal/Commands/ExplainCommand.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Spectre.Console/Cli/Internal/Commands/ExplainCommand.cs b/src/Spectre.Console/Cli/Internal/Commands/ExplainCommand.cs index ce2c5e3..8652737 100644 --- a/src/Spectre.Console/Cli/Internal/Commands/ExplainCommand.cs +++ b/src/Spectre.Console/Cli/Internal/Commands/ExplainCommand.cs @@ -44,9 +44,14 @@ namespace Spectre.Console.Cli if (settings.Commands == null || settings.Commands.Length == 0) { + // If there is a default command we'll want to include it in the list too. + var commands = _commandModel.DefaultCommand != null + ? new[] { _commandModel.DefaultCommand }.Concat(_commandModel.Commands) + : _commandModel.Commands; + AddCommands( tree.AddNode(ParentMarkup("Commands")), - _commandModel.Commands, + commands, settings.Detailed ?? false); } else