Adds default command to explain feature

This commit is contained in:
Phil Scott 2021-04-13 09:36:37 -04:00 committed by Patrik Svensson
parent 41ccc0b464
commit ae96606ab7

View File

@ -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