<commit_before>const chalk = require('chalk');
const argv = require('minimist')(process.argv.slice(2));

var conf = {};
conf.APP_NAME = 'depot';

const logger = require('./logger')(conf);
var commands = require('./commands');

function printUsage(message) {
  if (message) {
    console.error(chalk.red(conf.APP_NAME) + ':', message);
  }

  console.log('Usage: ' + conf.APP_NAME + ' <command>');
  console.log('Where <command> is one of: ');

  // List command names
  var command;
  for (var commandName in commands) {
    command = commands[commandName];
    console.log('  ' + chalk.yellow(commandName) + ' - ' + command.summary);
  }

  console.log();
  console.log(conf.APP_NAME + ' help <term>\tsearch for help on <term>')
}

// Display help message when not enough info given
var commandNameParam = argv._[0];
var isHelp = commandNameParam === 'help';
var subcommandNameParam = isHelp ? argv._[1] : null;
if ((argv._.length < 1) || (isHelp && !subcommandNameParam)) {
  printUsage();
  process.exit(1);
}

// Help command given with parameter
if (isHelp) {
  var helpCommand = commands[subcommandNameParam];
  if (!helpCommand) {
    printUsage('command not found: ' + subcommandNameParam);
    process.exit(2);
  }<commit_msg>Accidentally a<commit_after>const chalk = require('chalk');
const argv = require('minimist')(process.argv.slice(2));

var conf = {};
conf.APP_NAME = 'depot';

const logger = require('./logger')(conf);
var commands = require('./commands');

function printUsage(message) {
  if (message) {
    console.error(chalk.red(conf.APP_NAME) + ':', message);
  }

  console.log('Usage: ' + conf.APP_NAME + ' <command>');
  console.log('Where <command> is one of: ');

  // List command names
  var command;
  for (var commandName in commands) {
    command = commands[commandName];
    console.log('  ' + chalk.yellow(commandName) + ' - ' + command.summary);
  }

  console.log();
  console.log(conf.APP_NAME + ' help <term>\tsearch for help on <term>');
}

// Display help message when not enough info given
var commandNameParam = argv._[0];
var isHelp = commandNameParam === 'help';
var subcommandNameParam = isHelp ? argv._[1] : null;
if ((argv._.length < 1) || (isHelp && !subcommandNameParam)) {
  printUsage();
  process.exit(1);
}

// Help command given with parameter
if (isHelp) {
  var helpCommand = commands[subcommandNameParam];
  if (!helpCommand) {
    printUsage('command not found: ' + subcommandNameParam);
    process.exit(2);
  }
{'fraction_non_alphanumeric': 0.16545307443365695, 'fraction_numerical': 0.0048543689320388345, 'mean_word_length': 4.173640167364017, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '2915060', 'n_tokens_mistral': 810, 'n_tokens_neox': 791, 'n_words': 195}