using Translate.Interface;
using Translate.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Translate
{
  class Program
  {
      static void Main(string[] args)
      {
        IConfigurationBuilder builder = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
        IConfigurationRoot configurationRoot = builder.Build();
        CommandArgs commandArgs = new CommandArgs(args);
        IServiceCollection services = new ServiceCollection();
        services.AddSingleton<ICommandArgs>(commandArgs);
        services.AddSingleton<IConfigurationRoot>(configurationRoot);
        services.AddSingleton<IMainService,MainService>();
        services.AddSingleton<Executor,Executor>();
        services.BuildServiceProvider().GetService<Executor>().Execute();
      }

  }
}
