-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
40 lines (35 loc) · 1.21 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using harbor.Commands;
using harbor.Helpers;
using harbor.Shell;
using Microsoft.Extensions.DependencyInjection;
namespace harbor
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
// Boot dependency injection
var services = ConfigureServices();
var serviceProvider = services.BuildServiceProvider();
await serviceProvider.GetService<App>().RunAsync(args);
}
private static IServiceCollection ConfigureServices()
{
IServiceCollection services = new ServiceCollection();
// Register here
services.AddScoped<ServicesCollector>();
services.AddScoped<CommandsCollector>();
services.AddScoped<EnableCommand>();
services.AddScoped<ListCommand>();
services.AddScoped<StopCommand>();
services.AddScoped<StartCommand>();
services.AddScoped<DisableCommand>();
services.AddScoped<HelpCommand>();
services.AddScoped<LogCommand>();
services.AddScoped<Docker>();
services.AddTransient<App>();
return services;
}
}
}