Fix argument order in help

Closes #188
This commit is contained in:
Patrik Svensson
2021-01-01 13:31:54 +01:00
committed by Patrik Svensson
parent 5cf41725a5
commit b81739567b
7 changed files with 120 additions and 55 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace Spectre.Console.Cli.Internal
@ -51,5 +52,19 @@ namespace Spectre.Console.Cli.Internal
}
}
}
public List<CommandInfo> Flatten()
{
var result = new Stack<CommandInfo>();
var current = this;
while (current != null)
{
result.Push(current);
current = current.Parent;
}
return result.ToList();
}
}
}