sort commands alphabetically

This commit is contained in:
Yaakov 2021-09-30 22:12:37 +10:00
parent 58fc4892eb
commit e3db8d39f1

View file

@ -1,4 +1,5 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommandLine; using CommandLine;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -32,8 +33,8 @@ namespace Shamir.Console
var tree = new DefaultCommandTree( var tree = new DefaultCommandTree(
"shamir", "shamir",
"command-line multitool", "command-line multitool",
scope.ServiceProvider.GetServices<ICommandTree>().ToImmutableArray(), scope.ServiceProvider.GetServices<ICommandTree>().OrderBy(x => x.Name).ToImmutableArray(),
scope.ServiceProvider.GetServices<ICommand>().ToImmutableArray() scope.ServiceProvider.GetServices<ICommand>().OrderBy(x => x.Name).ToImmutableArray()
); );
var command = tree.FindCommand(args); var command = tree.FindCommand(args);