<commit_before>'use strict';

var _cli = require('./utils/cli');

phantom.onError = function(msg, trace) {
    var msgStack = ['PHANTOM ERROR: ' + msg];
    if (trace && trace.length) {
        msgStack.push('TRACE:');
        trace.forEach(function(t) {
            msgStack.push(' -> '
                + (t.file || t.sourceURL)
                + ': '
                + t.line
                + (t.function ? ' (in function ' + t.function + ')' : ''));
        });
    }
    console.error(msgStack.join('\n'));
    phantom.exit(1);
};

if (_cli.version) {
    // if --version is passed, print version and exit
    var json = require('../package.json');
    var version = json.version;

    console.log('Scout v' + version);
    console.log('http://mennovanslooten.github.io/Scout/');

    phantom.exit(0);
} else if (_cli.reformat) {
    // if --reformat is passed, reformat and exit<commit_msg>Accidentally commited dev code<commit_after>'use strict';

var _cli = require('./utils/cli');

if (_cli.version) {
    // if --version is passed, print version and exit
    var json = require('../package.json');
    var version = json.version;

    console.log('Scout v' + version);
    console.log('http://mennovanslooten.github.io/Scout/');

    phantom.exit(0);
} else if (_cli.reformat) {
    // if --reformat is passed, reformat and exit
{'fraction_non_alphanumeric': 0.17339312406576982, 'fraction_numerical': 0.002242152466367713, 'mean_word_length': 2.3727959697733, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6833877', 'n_tokens_mistral': 440, 'n_tokens_neox': 425, 'n_words': 97}