<commit_before>#!/usr/bin/env node

const fs = require("fs");
const pegjs = require("pegjs");
const tspegjs = require("./tspegjs.js");
const version = require("../package.json").version;

let args = process.argv;
args.shift();
args.shift();

const needHelp = args.find(a => a === "-h");

if (args.length === 0 || needHelp) {
    return showHelp();
}

const inFile = args[args.length - 1];
let outFile = inFile.replace(".pegjs", ".ts");
args.map((arg, index) => {
    if (arg === "-o") {
        outFile = args[index + 1];
    }
});
let allowedStartRules = null;
let tslintIgnores = null;
let customHeaderFile = null;
let customHeader = null;

args.map((arg, index) => {
    if (arg === "--allowed-start-rules") {
        allowedStartRules = args[index + 1];
    }
    if (arg === "--tslint-ignores") {
        tslintIgnores = args[index + 1];
    }
    if (arg === "--custom-header") {
        customHeader = args[index + 1];
    }<commit_msg>fix #53 allowedStartRules should be an array<commit_after>#!/usr/bin/env node

const fs = require("fs");
const pegjs = require("pegjs");
const tspegjs = require("./tspegjs.js");
const version = require("../package.json").version;

let args = process.argv;
args.shift();
args.shift();

const needHelp = args.find(a => a === "-h");

if (args.length === 0 || needHelp) {
    return showHelp();
}

const inFile = args[args.length - 1];
let outFile = inFile.replace(".pegjs", ".ts");
args.map((arg, index) => {
    if (arg === "-o") {
        outFile = args[index + 1];
    }
});
let allowedStartRules = null;
let tslintIgnores = null;
let customHeaderFile = null;
let customHeader = null;

args.map((arg, index) => {
    if (arg === "--allowed-start-rules") {
        allowedStartRules = (args[index + 1] | '').split(',');
    }
    if (arg === "--tslint-ignores") {
        tslintIgnores = args[index + 1];
    }
    if (arg === "--custom-header") {
        customHeader = args[index + 1];
    }
{'fraction_non_alphanumeric': 0.20155038759689922, 'fraction_numerical': 0.007235142118863049, 'mean_word_length': 3.119148936170213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2787118', 'n_tokens_mistral': 681, 'n_tokens_neox': 654, 'n_words': 163}