<commit_before>namespace GitFlowVersion
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;

    class Program
    {
        static void Main()
        {
            try
            {
                var arguments = ArgumentParser.ParseArguments(GetArgumentsWithoutExeName());

                if (arguments.IsHelp)
                {
                    HelpWriter.Write();
                    return;
                }
                ConfigureLogging(arguments);
                var gitDirectory = GitDirFinder.TreeWalkForGitDir(arguments.TargetPath);

                if (string.IsNullOrEmpty(gitDirectory))
                {
                    Console.Error.WriteLine("Could not find .git directory");
                    Environment.Exit(1);
                }

                var variables = VersionCache.GetVersion(gitDirectory);

                switch (arguments.VersionPart)
                {
                    case null: 
                        Console.WriteLine(JsonOutputFormatter.ToJson(variables)); 
                        break;
                    default:
                        Console.WriteLine(variables[arguments.VersionPart]);
                        break;
                }
                    
            }
            catch (ErrorException exception)
            {
                Console.Error.Write("An error occurred:\r\n{0}", exception.Message);
                Environment.Exit(1);
            }
            catch (Exception exception)
            {
                Console.Error.Write("An unexpected error occurred:\r\n{0}", exception);
                Environment.Exit(1);
            }
        }

        static void ConfigureLogging(Arguments arguments)
        {
            if (arguments.LogFilePath == null)
            {
                Logger.WriteInfo = s =>{};
            }<commit_msg>Fixing command line version so it works in teamcity<commit_after>namespace GitFlowVersion
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;

    class Program
    {
        static void Main()
        {
            try
            {
                var arguments = ArgumentParser.ParseArguments(GetArgumentsWithoutExeName());

                if (arguments.IsHelp)
                {
                    HelpWriter.Write();
                    return;
                }
                ConfigureLogging(arguments);
                var gitDirectory = GitDirFinder.TreeWalkForGitDir(arguments.TargetPath);

                if (string.IsNullOrEmpty(gitDirectory))
                {
                    Console.Error.WriteLine("Could not find .git directory");
                    Environment.Exit(1);
                }

                var applicableBuildServers = GetApplicableBuildServers().ToList();

                foreach (var buildServer in applicableBuildServers)
                {
                    buildServer.PerformPreProcessingSteps(gitDirectory);
                }

                var variables = VersionCache.GetVersion(gitDirectory);

                switch (arguments.VersionPart)
                {
                    case null: 
                        Console.WriteLine(JsonOutputFormatter.ToJson(variables)); 
                        break;
                    default:
                        Console.WriteLine(variables[arguments.VersionPart]);
                        break;
                }
                    
            }
            catch (ErrorException exception)
            {
                Console.Error.Write("An error occurred:\r\n{0}", exception.Message);
                Environment.Exit(1);
            }
            catch (Exception exception)
            {
                Console.Error.Write("An unexpected error occurred:\r\n{0}", exception);
                Environment.Exit(1);
            }
        }

        static IEnumerable<IBuildServer> GetApplicableBuildServers()
        {
            return BuildServerList.BuildServers.Where(buildServer => buildServer.CanApplyToCurrentContext());
        }

        static void ConfigureLogging(Arguments arguments)
        {
            if (arguments.LogFilePath == null)
            {
                Logger.WriteInfo = s =>{};
            }
{'fraction_non_alphanumeric': 0.07841760299625468, 'fraction_numerical': 0.0023408239700374533, 'mean_word_length': 1.2489473684210526, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, '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': '1275582', 'n_tokens_mistral': 979, 'n_tokens_neox': 897, 'n_words': 169}