<commit_before>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MetadataGeneration.Core;

namespace MetadataGenerator
{
    class Program
    {
        enum ExitCode : int
        {
            Success = 0,
            Failure = 1
        }

        static int Main(string[] args)
        {
            var generator = new Generator();
            var reader = new WcfConfigReader();

            if (args.Length == 0)
            {
                DisplayUsage();
                return (int)ExitCode.Failure;
            }

            var configFile = ExtractArg(args,"--ConfigFile");
            var assemblySearchPath = ExtractArg(args, "--AssemblySearchPath");
            var jschemaOutputFileName = ExtractArg(args, "--JschemaOutput");
            var smdOutputFileName = ExtractArg(args, "--SMDOutput");
            var streamingSMD = ExtractArg(args, "--StreamingSMD");

                
            var xmlDocSource = reader.Read(configFile, assemblySearchPath);

            var jsonSchemaResults = generator.GenerateJsonSchema(xmlDocSource);
            File.WriteAllText(jschemaOutputFileName, jsonSchemaResults.JsonSchema.ToString());

            var smdResults = generator.GenerateSmd(xmlDocSource, jsonSchemaResults.JsonSchema);

            var streaming = File.ReadAllText(streamingSMD);
            generator.AddStreamingSMD(smdResults.SMD, streaming);

            File.WriteAllText(smdOutputFileName, smdResults.SMD.ToString());

            if (jsonSchemaResults.HasErrors || smdResults.HasErrors)
            {
                Console.WriteLine(string.Join(@"\r\n", jsonSchemaResults.MetadataGenerationErrors.Select(e => e.ToString())));
                Console.WriteLine(string.Join(@"\r\n", jsonSchemaResults.MetadataGenerationErrors.Select(e => e.ToString())));
                return (int)ExitCode.Failure;
            }

            return (int)ExitCode.Success;
        }
<commit_msg>Output OK or ERROR as well as exit code<commit_after>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MetadataGeneration.Core;

namespace MetadataGenerator
{
    class Program
    {
        enum ExitCode : int
        {
            Success = 0,
            Failure = 1
        }

        static int Main(string[] args)
        {
            var generator = new Generator();
            var reader = new WcfConfigReader();

            if (args.Length == 0)
            {
                DisplayUsage();
                return (int)ExitCode.Failure;
            }

            var configFile = ExtractArg(args,"--ConfigFile");
            var assemblySearchPath = ExtractArg(args, "--AssemblySearchPath");
            var jschemaOutputFileName = ExtractArg(args, "--JschemaOutput");
            var smdOutputFileName = ExtractArg(args, "--SMDOutput");
            var streamingSMD = ExtractArg(args, "--StreamingSMD");

                
            var xmlDocSource = reader.Read(configFile, assemblySearchPath);

            var jsonSchemaResults = generator.GenerateJsonSchema(xmlDocSource);
            File.WriteAllText(jschemaOutputFileName, jsonSchemaResults.JsonSchema.ToString());

            var smdResults = generator.GenerateSmd(xmlDocSource, jsonSchemaResults.JsonSchema);

            var streaming = File.ReadAllText(streamingSMD);
            generator.AddStreamingSMD(smdResults.SMD, streaming);

            File.WriteAllText(smdOutputFileName, smdResults.SMD.ToString());

            if (jsonSchemaResults.HasErrors || smdResults.HasErrors)
            {
                Console.WriteLine("ERROR");
                Console.WriteLine(string.Join(@"\r\n", jsonSchemaResults.MetadataGenerationErrors.Select(e => e.ToString())));
                Console.WriteLine(string.Join(@"\r\n", smdResults.MetadataGenerationErrors.Select(e => e.ToString())));
                
                PauseIfDebugBuild();
                return (int)ExitCode.Failure;
            }

            Console.WriteLine("OK");
            PauseIfDebugBuild();
            return (int)ExitCode.Success;
        }

        private static void PauseIfDebugBuild()
        {
            #if DEBUG
            Console.ReadKey();
            #endif
        }

{'fraction_non_alphanumeric': 0.10141509433962265, 'fraction_numerical': 0.0014150943396226414, 'mean_word_length': 2.086608442503639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '6416838', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1043, 'n_words': 202}