<commit_before>﻿using System;
using System.Text;
using System.IO;
using System.Linq;
using System.Drawing.Imaging;

namespace text2img
{
    class Program
    {
        /// <summary>
        /// Default codepage to use
        /// </summary>
        public const int DEFAULT_CP = 437;
        /// <summary>
        /// Argument to use console input/output
        /// </summary>
        public const string STDIO = "-";

        /// <summary>
        /// Command line argument structure
        /// </summary>
        private struct Arguments
        {
            /// <summary>
            /// Input file
            /// </summary>
            public string InFile;
            /// <summary>
            /// Output file
            /// </summary>
            public string OutFile;
            /// <summary>
            /// Arguments valid
            /// </summary>
            public bool Valid;
            /// <summary>
            /// Help requested
            /// </summary>
            public bool HelpRequest;
            /// <summary>
            /// Codepage list requested
            /// </summary>
            public bool List;
            /// <summary>
            /// User supplied Codepage
            /// </summary>
            public Encoding Codepage;

            /// <summary>
            /// Initializes defaults
            /// </summary>
            public void Init()
            {
                InFile = OutFile = null;
                Valid = true;
                HelpRequest = List = false;
                Codepage = null;
            }

        }

        /// <summary>
        /// Possible exit codes
        /// </summary>
        private enum EXITCODE : int
        {
            /// <summary>
            /// No errors
            /// </summary>
            SUCCESS = 0,
            /// <summary>
            /// No arguments provided
            /// </summary>
            NO_ARGS = SUCCESS + 1,
            /// <summary>
            /// Invalid/Unsupported argument
            /// </summary>
            INVALID_ARGS = NO_ARGS + 1,
            /// <summary>
            /// Cannot read source file
            /// </summary>
            ERR_READ = INVALID_ARGS + 1,
            /// <summary>
            /// Cannot write destination file
            /// </summary>
            ERR_WRITE = ERR_READ + 1,
            /// <summary>
            /// Invalid codepage specified
            /// </summary>
            ERR_CP = ERR_WRITE + 1,
            /// <summary>
            /// Help requested
            /// </summary>
            HELP_REQUEST = ERR_CP + 1,
            /// <summary>
            /// Codepage list requested
            /// </summary>
            LIST_REQUEST = HELP_REQUEST + 1
        }

        /// <summary>
        /// Main entry point
        /// </summary>
        /// <param name="args">Command line arguments</param>
        /// <returns>Exit code</returns>
        public static int Main(string[] args)
        {
#if DEBUG
            /*
            args = new string[] {
                @"D:\Allfilez\Downloads\JD\Der.Prinz.aus.Zamunda.1988.German.AC3.BDRip.XviD.iNTERNAL-EXPS\exps-prinzauszamunda-xvid.nfo"
            };
            //*/
#endif
            if (args.Length == 0)
            {
                Help(EXITCODE.NO_ARGS);
            }
            Arguments A = ParseArgs(args);

            if (!A.Valid)
            {
                return (int)EXITCODE.INVALID_ARGS;<commit_msg>Remove local specific debug settings<commit_after>﻿using System;
using System.Text;
using System.IO;
using System.Linq;
using System.Drawing.Imaging;

namespace text2img
{
    class Program
    {
        /// <summary>
        /// Default codepage to use
        /// </summary>
        public const int DEFAULT_CP = 437;
        /// <summary>
        /// Argument to use console input/output
        /// </summary>
        public const string STDIO = "-";

        /// <summary>
        /// Command line argument structure
        /// </summary>
        private struct Arguments
        {
            /// <summary>
            /// Input file
            /// </summary>
            public string InFile;
            /// <summary>
            /// Output file
            /// </summary>
            public string OutFile;
            /// <summary>
            /// Arguments valid
            /// </summary>
            public bool Valid;
            /// <summary>
            /// Help requested
            /// </summary>
            public bool HelpRequest;
            /// <summary>
            /// Codepage list requested
            /// </summary>
            public bool List;
            /// <summary>
            /// User supplied Codepage
            /// </summary>
            public Encoding Codepage;

            /// <summary>
            /// Initializes defaults
            /// </summary>
            public void Init()
            {
                InFile = OutFile = null;
                Valid = true;
                HelpRequest = List = false;
                Codepage = null;
            }

        }

        /// <summary>
        /// Possible exit codes
        /// </summary>
        private enum EXITCODE : int
        {
            /// <summary>
            /// No errors
            /// </summary>
            SUCCESS = 0,
            /// <summary>
            /// No arguments provided
            /// </summary>
            NO_ARGS = SUCCESS + 1,
            /// <summary>
            /// Invalid/Unsupported argument
            /// </summary>
            INVALID_ARGS = NO_ARGS + 1,
            /// <summary>
            /// Cannot read source file
            /// </summary>
            ERR_READ = INVALID_ARGS + 1,
            /// <summary>
            /// Cannot write destination file
            /// </summary>
            ERR_WRITE = ERR_READ + 1,
            /// <summary>
            /// Invalid codepage specified
            /// </summary>
            ERR_CP = ERR_WRITE + 1,
            /// <summary>
            /// Help requested
            /// </summary>
            HELP_REQUEST = ERR_CP + 1,
            /// <summary>
            /// Codepage list requested
            /// </summary>
            LIST_REQUEST = HELP_REQUEST + 1
        }

        /// <summary>
        /// Main entry point
        /// </summary>
        /// <param name="args">Command line arguments</param>
        /// <returns>Exit code</returns>
        public static int Main(string[] args)
        {
            if (args.Length == 0)
            {
                Help(EXITCODE.NO_ARGS);
            }
            Arguments A = ParseArgs(args);

            if (!A.Valid)
            {
                return (int)EXITCODE.INVALID_ARGS;
{'fraction_non_alphanumeric': 0.12447885646217986, 'fraction_numerical': 0.004615842763549732, 'mean_word_length': 0.9543206284550481, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6137142', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1616, 'n_words': 422}