<commit_before>import { log } from './common/util/log';


// NOTE: event name is camelCase as per node convention
process.on('unhandledRejection', function (reason: Error, promise: Promise<any>) {
	log.error(reason);
});

import * as common from './common';
import cli from 'command-interface';
import config from './common/config';

async function init(cb: Function) {
	cli(config.SCRIPTS_DIRS);
	cb();
}<commit_msg>Add version flag<commit_after>import * as path from 'path';
import * as fs from 'fs';
import { loadavg } from 'os';
import { log } from './common/util/log';


// NOTE: event name is camelCase as per node convention
process.on('unhandledRejection', function (reason: Error, promise: Promise<any>) {
	log.error(reason);
});

import * as common from './common';
import cli from 'command-interface';
import config from './common/config';
import * as minimist from 'minimist';

function checkVersionFlag() {
	const argv: { version?: boolean, v?: boolean } = minimist(process.argv.slice(1));
	return argv.version || argv.v;
}

async function init(cb: Function) {
	if (checkVersionFlag()) {
		log.info.blue(require(path.resolve(__dirname, '../package.json')).version);
		return;
	}


	cli(config.SCRIPTS_DIRS);
	cb();
}
{'fraction_non_alphanumeric': 0.15703824247355574, 'fraction_numerical': 0.0008136696501220504, 'mean_word_length': 4.829383886255924, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5232035', 'n_tokens_mistral': 391, 'n_tokens_neox': 384, 'n_words': 116}