ant-design-blazor/site/AntDesign.Docs.Build.CLI/AppCommandResolver.cs
2020-05-29 00:33:49 +08:00

23 lines
616 B
C#

using System.Collections.Generic;
using Microsoft.Extensions.CommandLineUtils;
namespace AntDesign.Docs.Build.CLI
{
public class AppCommandResolver : IAppCommandResolver
{
private readonly IEnumerable<IAppCommand> _appCommands;
public AppCommandResolver(IEnumerable<IAppCommand> appCommands)
{
_appCommands = appCommands;
}
public void Resolve(CommandLineApplication application)
{
foreach (var command in _appCommands)
{
application.Command(command.Name, command.Execute);
}
}
}
}