<commit_before>﻿using System;
using System.Diagnostics;
using Topshelf;

namespace SupportManager.Telegram
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = new Configuration();
            var exitCode = HostFactory.Run(cfg =>
            {
                cfg.AddCommandLineDefinition("botkey", v => config.BotKey = v);
                cfg.AddCommandLineDefinition("url", v => config.SupportManagerUri = new Uri(v));

                cfg.Service<Service>(svc =>
                {
                    svc.ConstructUsing(() => new Service(config));
                    svc.WhenStarted((s, h) => s.Start(h));
                    svc.WhenStopped((s, h) => s.Stop(h));
                });

                cfg.SetServiceName("SupportManager.Telegram");
                cfg.SetDisplayName("SupportManager.Telegram");
                cfg.SetDescription("SupportManager Telegram bot");

                cfg.RunAsNetworkService();

                cfg.StartAutomatically();
            });
            Debugger.Break();
        }
    }
}<commit_msg>telegram: Add migrate commandline support<commit_after>﻿using System;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
using SupportManager.Telegram.DAL;
using Topshelf;

namespace SupportManager.Telegram
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Any() && args[0].EndsWith("migrate", StringComparison.InvariantCultureIgnoreCase))
            {
                var db = new UserDbContext();
                db.Database.Migrate();
                return;
            }

            var config = new Configuration();
            var exitCode = HostFactory.Run(cfg =>
            {
                cfg.AddCommandLineDefinition("botkey", v => config.BotKey = v);
                cfg.AddCommandLineDefinition("url", v => config.SupportManagerUri = new Uri(v));

                cfg.Service<Service>(svc =>
                {
                    svc.ConstructUsing(() => new Service(config));
                    svc.WhenStarted((s, h) => s.Start(h));
                    svc.WhenStopped((s, h) => s.Stop(h));
                });

                cfg.SetServiceName("SupportManager.Telegram");
                cfg.SetDisplayName("SupportManager.Telegram");
                cfg.SetDescription("SupportManager Telegram bot");

                cfg.RunAsNetworkService();

                cfg.StartAutomatically();
            });
            Debugger.Break();
        }
    }
}
{'fraction_non_alphanumeric': 0.11693861693861694, 'fraction_numerical': 0.0003885003885003885, 'mean_word_length': 1.7393617021276595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3203131', 'n_tokens_mistral': 678, 'n_tokens_neox': 637, 'n_words': 116}