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

var docopt = require('docopt').docopt,
  pkg = require(__dirname + '/../package.json'),
  fs = require('fs'),
  debug = require('debug')('mj:bin');

var cli = fs.readFileSync('./docopts/main.docopt', 'utf-8');
var argv = docopt(cli, {
  version: pkg.version,
  options_first: true
});

// handle "mj help"
if (argv['<command>'] === 'help') {
  debug('showing help');
  // only output main help screen
  console.log(cli);
  process.exit(0);
}

// pass on to sub parser
var cmd = argv['<command>'];
try {
  cli = fs.readFileSync('./docopts/' + cmd + '.docopt', 'utf-8');
} catch (e) {
  console.error('Unknown command "' + cmd + '". See "mj help" for available commands.');
  process.exit(1);
}

argv = docopt(cli, {
  version: pkg.version,
  options_first: false
});

argv['<command>'] = cmd;
<commit_msg>more explicit debug msg.<commit_after>#!/usr/bin/env node

var docopt = require('docopt').docopt,
  pkg = require(__dirname + '/../package.json'),
  fs = require('fs'),
  debug = require('debug')('mj:bin');

var cli = fs.readFileSync('./docopts/main.docopt', 'utf-8');
var argv = docopt(cli, {
  version: pkg.version,
  options_first: true
});

// handle "mj help"
if (argv['<command>'] === 'help') {
  debug('showing help text directly, not via help command');
  // only output main help screen
  console.log(cli);
  process.exit(0);
}

// pass on to sub parser
var cmd = argv['<command>'];
try {
  cli = fs.readFileSync('./docopts/' + cmd + '.docopt', 'utf-8');
} catch (e) {
  console.error('Unknown command "' + cmd + '". See "mj help" for available commands.');
  process.exit(1);
}

argv = docopt(cli, {
  version: pkg.version,
  options_first: false
});

argv['<command>'] = cmd;

{'fraction_non_alphanumeric': 0.20729588882455124, 'fraction_numerical': 0.004632310364794441, 'mean_word_length': 3.867605633802817, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1581902', 'n_tokens_mistral': 623, 'n_tokens_neox': 608, 'n_words': 153}