You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DiscordChatExporter/DiscordChatExporter.Cli/Program.cs

35 lines
961 B

using System.Threading.Tasks;
using CliFx;
using DiscordChatExporter.Core.Services;
using StyletIoC;
namespace DiscordChatExporter.Cli
{
public static class Program
{
private static IContainer BuildContainer()
{
var builder = new StyletIoCBuilder();
// Autobind the .Services assembly
builder.Autobind(typeof(DataService).Assembly);
// Bind settings as singleton
builder.Bind<SettingsService>().ToSelf().InSingletonScope();
// Set instance
return builder.BuildContainer();
}
public static Task<int> Main(string[] args)
{
var container = BuildContainer();
return new CliApplicationBuilder()
.AddCommandsFromThisAssembly()
.UseCommandFactory(schema => (ICommand) container.Get(schema.Type))
.Build()
.RunAsync(args);
}
}
}