<commit_before>﻿using System;
using Mono.Options;
using System.IO;
using System.Threading;

namespace TestApp
{
    class Program
    {
        static int Main(string[] args)
        {
            int retCode = 0;
            string ret = String.Empty;
            string error = String.Empty;

            int sleepms = 0;
            var p = new OptionSet();
            p = p
                .Add("r=", (int v) => retCode = v)
                .Add("d=|data=", v => ret = v)
                .Add("e=|error=", v => error = v)
                .Add("f=|file=", v => ret = File.ReadAllText(v))
                .Add("ef=|errorFile=", v => error = File.ReadAllText(v))
                .Add("s=|sleep=", (int v) => sleepms = v)
                .Add("h|help", v => p.WriteOptionDescriptions(Console.Out));

            p.Parse(args);

            if (sleepms > 0)
                Thread.Sleep(sleepms);

            if (!String.IsNullOrEmpty(ret))
                Console.WriteLine(ret);
            if (!String.IsNullOrEmpty(error))
                Console.Error.WriteLine(error);
            return retCode;
        }
    }
}<commit_msg>Adding functionality to the TestApp to read input from STDIN until EOF<commit_after>﻿using System;
using System.Collections.Generic;
using Mono.Options;
using System.IO;
using System.Threading;

namespace TestApp
{
    class Program
    {
        static int Main(string[] args)
        {
            int retCode = 0;
            string ret = null;
            string error = null;

            int sleepms = 0;
            var p = new OptionSet();
            var reaadInputToEof = false;
            p = p
                .Add("r=", (int v) => retCode = v)
                .Add("d=|data=", v => ret = v)
                .Add("e=|error=", v => error = v)
                .Add("f=|file=", v => ret = File.ReadAllText(v))
                .Add("ef=|errorFile=", v => error = File.ReadAllText(v))
                .Add("s=|sleep=", (int v) => sleepms = v)
                .Add("i|input", v => reaadInputToEof = true)
                .Add("h|help", v => p.WriteOptionDescriptions(Console.Out));

            p.Parse(args);

            if (ret != null && reaadInputToEof)
            {
                Console.Error.WriteLine("Cannot use -d and -i together");
                return -1;
            }

            if (reaadInputToEof)
            {
                var lines = new List<string>();
                string line;
                while ((line = Console.ReadLine()) != null)
                {
                    lines.Add(line);
                }

                ret = string.Join(Environment.NewLine, lines.ToArray());
            }

            if (sleepms > 0)
                Thread.Sleep(sleepms);

            if (!String.IsNullOrEmpty(ret))
                Console.WriteLine(ret);

            if (!String.IsNullOrEmpty(error))
                Console.Error.WriteLine(error);

            return retCode;
        }
    }
}
{'fraction_non_alphanumeric': 0.1330414280902661, 'fraction_numerical': 0.0023576961940047153, 'mean_word_length': 1.391304347826087, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 21, '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': '6411158', 'n_tokens_mistral': 887, 'n_tokens_neox': 839, 'n_words': 200}