<commit_before>var _         = require('lodash');
var f         = require('util').format;
var commander = require('commander');

commander
  .version('0.1.0')
  .option('-l, --language [language]', 'Language to get search for for repos [javascript]', 'javascript')
  .option('-r, --records [num]', 'Number of records to get [100]', determineRecords)
  .option('-d, --debug', 'Start with debugger')
  .parse(process.argv);

if (!commander.records) commander.records = determineRecords(100);

module.exports = commander;

function list(val) {
    return val.split(',');
}

function determineRecords(records) {
    if (!records) records = 100;
    records = +records;

    // max 100 per page
    var numPages = Math.ceil(records / 100);
    var leftover = records % 100;

    return _.map(_.range(numPages), function (page) {
        var perPage = Math.min(records, 100);
        if (page == numPages - 1 && leftover) perPage = leftover;
        return {
            page: page + 1,
            perPage: perPage
        };
    });
}<commit_msg>Oh the little things.<commit_after>var _         = require('lodash');
var f         = require('util').format;
var commander = require('commander');

commander
  .version('0.1.0', '-v, --version')
  .option('-l, --language [language]', 'language to get search for for repos [javascript]', 'javascript')
  .option('-r, --records [num]', 'number of records to get [100]', determineRecords)
  .option('-d, --debug', 'start with node-monkey debugger')
  .parse(process.argv);

if (!commander.records) commander.records = determineRecords(100);

module.exports = commander;

function list(val) {
    return val.split(',');
}

function determineRecords(records) {
    if (!records) records = 100;
    records = +records;

    // max 100 per page
    var numPages = Math.ceil(records / 100);
    var leftover = records % 100;

    return _.map(_.range(numPages), function (page) {
        var perPage = Math.min(records, 100);
        if (page == numPages - 1 && leftover) perPage = leftover;
        return {
            page: page + 1,
            perPage: perPage
        };
    });
}
{'fraction_non_alphanumeric': 0.157001414427157, 'fraction_numerical': 0.024516737388024516, 'mean_word_length': 2.900735294117647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5129884', 'n_tokens_mistral': 704, 'n_tokens_neox': 640, 'n_words': 184}