<commit_before>module TypeDoc
{
    /**
     * Holds all settings used by TypeDoc.
     */
    export class Settings
    {
        /**
         * The settings used by the TypeScript compiler.
         */
        compiler:TypeScript.CompilationSettings;

        /**
         * The list of source files that should be processed.
         */
        inputFiles:string[];

        /**
         * The path of the output directory.
         */
        outputDirectory:string;

        /**
         * The human readable name of the project. Used within the templates to set the title of the document.
         */
        name:string;

        /**
         * A pattern for files that should be excluded when a path is specified as source.
         */
        excludePattern:string;

        /**
         * Should declaration files be documented?
         */
        includeDeclarations:boolean = false;

        /**
         * Does the user want to display the help message?
         */
        needsHelp:boolean = false;

        /**
         * Does the user want to know the version number?
         */
        shouldPrintVersionOnly:boolean = false;

        /**
         * Should verbose messages be printed?
         */
        verbose:boolean = false;



        /**
         * Create a new Settings instance.
         */
        constructor() {
            this.compiler = new TypeScript.CompilationSettings();
        }


        /**
         * Read the settings from command line arguments.
         */
        readFromCommandline(application:IApplication):boolean {
            var opts = this.createOptionsParser();

            try {
                opts.parse(TypeScript.IO.arguments);
            } catch (e) {
                application.log(e.message, LogLevel.Error);
                return false;
            }

            this.inputFiles = opts.unnamed;

            if (this.shouldPrintVersionOnly) {
                opts.printVersion();
                return false;
            } else if (this.inputFiles.length === 0 || this.needsHelp) {
                opts.printUsage();
                return false;
            }

            return true;
        }


        /**
         * Expand the list of input files.
         *
         * Searches for directories in the input files list and replaces them with a
         * listing of all TypeScript files within them. One may use the exlclude option
         * to filter out files aith a pattern.
         */
        public expandInputFiles() {
            var exclude, files = [];
            if (this.excludePattern) {
                exclude = new Minimatch.Minimatch(this.excludePattern);
            }

            function add(dirname) {
                FS.readdirSync(dirname).forEach((file) => {
                    var realpath = TypeScript.IOUtils.combine(dirname, file);
                    if (FS.statSync(realpath).isDirectory()) {
                        add(realpath);
                    } else if (/\.ts$/.test(realpath)) {
                        if (exclude && exclude.match(realpath.replace(/\\/g, '/'))) {
                            return;
                        }

                        files.push(realpath);
                    }
                });
            }

            this.inputFiles.forEach((file) => {
                file = Path.resolve(file);
                if (FS.statSync(file).isDirectory()) {
                    add(file);
                } else {
                    files.push(file);
                }
            });

            this.inputFiles = files;
        }


        /**
         * Create and initialize an instance of OptionsParser to read command line arguments.
         *
         * This function partially contains the options found in [[TypeScript.BatchCompiler.parseOptions]].
         * When updating the TypeScript compiler, new options should be copied over here.
         *
         * @returns An initialized OptionsParser instance.
         */
        private createOptionsParser():TypeScript.OptionsParser {
            var opts = new TypeScript.OptionsParser(TypeScript.IO, VERSION);

            opts.option('out', {
                usage: {
                    locCode: 'Specifies the location the documentation should be written to.',
                    args: null
                },
                type: TypeScript.DiagnosticCode.DIRECTORY,
                set: (str) => {
                    this.outputDirectory = Path.resolve(str);
                }
            });

            opts.option('exclude', {
                usage: {
                    locCode: 'Define a pattern for excluded files when specifing paths.',
                    args: null
                },
                set: (str) => {
                    this.excludePattern = str;
                }
            });

            opts.flag('includeDeclarations', {
                usage: {<commit_msg>Added theme option<commit_after>module TypeDoc
{
    /**
     * Holds all settings used by TypeDoc.
     */
    export class Settings
    {
        /**
         * The settings used by the TypeScript compiler.
         */
        compiler:TypeScript.CompilationSettings;

        /**
         * The list of source files that should be processed.
         */
        inputFiles:string[];

        /**
         * The path of the output directory.
         */
        outputDirectory:string;

        /**
         * The path of the theme that should be used.
         */
        theme:string = 'default';

        /**
         * The human readable name of the project. Used within the templates to set the title of the document.
         */
        name:string;

        /**
         * A pattern for files that should be excluded when a path is specified as source.
         */
        excludePattern:string;

        /**
         * Should declaration files be documented?
         */
        includeDeclarations:boolean = false;

        /**
         * Does the user want to display the help message?
         */
        needsHelp:boolean = false;

        /**
         * Does the user want to know the version number?
         */
        shouldPrintVersionOnly:boolean = false;

        /**
         * Should verbose messages be printed?
         */
        verbose:boolean = false;



        /**
         * Create a new Settings instance.
         */
        constructor() {
            this.compiler = new TypeScript.CompilationSettings();
        }


        /**
         * Read the settings from command line arguments.
         */
        readFromCommandline(application:IApplication):boolean {
            var opts = this.createOptionsParser();

            try {
                opts.parse(TypeScript.IO.arguments);
            } catch (e) {
                application.log(e.message, LogLevel.Error);
                return false;
            }

            this.inputFiles = opts.unnamed;

            if (this.shouldPrintVersionOnly) {
                opts.printVersion();
                return false;
            } else if (this.inputFiles.length === 0 || this.needsHelp) {
                opts.printUsage();
                return false;
            }

            return true;
        }


        /**
         * Expand the list of input files.
         *
         * Searches for directories in the input files list and replaces them with a
         * listing of all TypeScript files within them. One may use the exlclude option
         * to filter out files aith a pattern.
         */
        public expandInputFiles() {
            var exclude, files = [];
            if (this.excludePattern) {
                exclude = new Minimatch.Minimatch(this.excludePattern);
            }

            function add(dirname) {
                FS.readdirSync(dirname).forEach((file) => {
                    var realpath = TypeScript.IOUtils.combine(dirname, file);
                    if (FS.statSync(realpath).isDirectory()) {
                        add(realpath);
                    } else if (/\.ts$/.test(realpath)) {
                        if (exclude && exclude.match(realpath.replace(/\\/g, '/'))) {
                            return;
                        }

                        files.push(realpath);
                    }
                });
            }

            this.inputFiles.forEach((file) => {
                file = Path.resolve(file);
                if (FS.statSync(file).isDirectory()) {
                    add(file);
                } else {
                    files.push(file);
                }
            });

            this.inputFiles = files;
        }


        /**
         * Create and initialize an instance of OptionsParser to read command line arguments.
         *
         * This function partially contains the options found in [[TypeScript.BatchCompiler.parseOptions]].
         * When updating the TypeScript compiler, new options should be copied over here.
         *
         * @returns An initialized OptionsParser instance.
         */
        private createOptionsParser():TypeScript.OptionsParser {
            var opts = new TypeScript.OptionsParser(TypeScript.IO, VERSION);

            opts.option('out', {
                usage: {
                    locCode: 'Specifies the location the documentation should be written to.',
                    args: null
                },
                type: TypeScript.DiagnosticCode.DIRECTORY,
                set: (str) => {
                    this.outputDirectory = Path.resolve(str);
                }
            });

            opts.option('theme', {
                usage: {
                    locCode: 'Specify the path to the theme that should be used.',
                    args: null
                },
                set: (str) => {
                    this.theme = str;
                }
            });

            opts.option('exclude', {
                usage: {
                    locCode: 'Define a pattern for excluded files when specifing paths.',
                    args: null
                },
                set: (str) => {
                    this.excludePattern = str;
                }
            });

            opts.flag('includeDeclarations', {
                usage: {
{'fraction_non_alphanumeric': 0.0902071931196247, 'fraction_numerical': 0.00019546520719311962, 'mean_word_length': 1.2308698495748855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '5075100', 'n_tokens_mistral': 2461, 'n_tokens_neox': 2293, 'n_words': 660}