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

(function(process)
{

    'use strict';

    var exec = require('child_process').exec;
    var fs = require('fs');
    var os = require('os');
    var colors = require('colors');
    var argv = require('yargs').argv;

    var Reporter = require('./core.js');

    var manifest = require('../package.json');

    if (argv.version)
    {
        console.log('psi-report ' + manifest.version);
        process.exit(0);
    }

    var format = typeof argv.format !== 'undefined' && argv.format === 'json' ? 'json' : 'html';
    var reporter = new Reporter({<commit_msg>Adds help in cli.js<commit_after>#!/usr/bin/env node

(function(process)
{

    'use strict';

    var exec = require('child_process').exec;
    var fs = require('fs');
    var os = require('os');
    var colors = require('colors');
    var argv = require('yargs').argv;

    var Reporter = require('./core.js');

    var manifest = require('../package.json');

    if (argv.version)
    {
        console.log('psi-report ' + manifest.version);
        process.exit(0);
    }

    if (argv.help)
    {
        var help = [
            '',
            'Crawls a website, gets PageSpeed Insights data for each page, and builds a report in HTML or JSON',
            '',
            'Usage:',
            '    psi-report <url>',
            '',
            'Example:',
            '    psi-report daringfireball.net/projects/markdown --output=json --open',
            '',
            'Options:',
            '    --format                Sets output format: html|json (default is html)',
            '    --save=</my/file.html>  Sets destination file (will save in OS temp dir if empty)',
            '    --stdout                Echoes the result code (html or json) instead of saving it on the disk',
            '    --open                  Opens the generated report in the default application. (OSX only)',
            '    --version               Outputs current version'
        ];
        console.log(help.join('\n'));
        process.exit(0);
    }

    var format = typeof argv.format !== 'undefined' && argv.format === 'json' ? 'json' : 'html';
    var reporter = new Reporter({
{'fraction_non_alphanumeric': 0.15089163237311384, 'fraction_numerical': 0.0013717421124828531, 'mean_word_length': 1.9095744680851063, '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': '3245234', 'n_tokens_mistral': 635, 'n_tokens_neox': 614, 'n_words': 173}