mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-11-29 18:48:50 +08:00
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using AntDesign.Docs.Build.CLI.Extensions;
|
|
using Microsoft.Extensions.CommandLineUtils;
|
|
|
|
namespace AntDesign.Docs.Build.CLI
|
|
{
|
|
public class CommandLineApplicationFactory
|
|
{
|
|
private readonly IAppCommandResolver _appCommandResolver;
|
|
|
|
public CommandLineApplicationFactory(IAppCommandResolver appCommandResolver)
|
|
{
|
|
_appCommandResolver = appCommandResolver;
|
|
}
|
|
|
|
public CommandLineApplication Create()
|
|
{
|
|
var app = new CommandLineApplication
|
|
{
|
|
Name = "ant-design-blazor",
|
|
FullName = "Ant Design Blazor Command Line Tool",
|
|
Description =
|
|
"Generate demo structured file for Docs."
|
|
};
|
|
|
|
app.HelpOption();
|
|
app.VersionOptionFromAssemblyAttributes(typeof(Program).Assembly);
|
|
|
|
app.OnExecute(() =>
|
|
{
|
|
app.ShowHelp();
|
|
return 2;
|
|
});
|
|
|
|
_appCommandResolver.Resolve(app);
|
|
|
|
return app;
|
|
}
|
|
}
|
|
} |