<commit_before>// Module dependencies.
var debug = require('debug')('ruche:help');
var fs = require('fs');
var path = require('path');
var _ = require('underscore');
var emitter = require('./util/emitter');
var error = require('./util/error');
var valid = require('./util/valid');

/**
 * Show a contextual help.
 * @fires RucheEmitter#help
 * @param  {String} [context] Command you want to know more about.
 */
var help = function (context) {
  if (context === 'global') {
    var file = 'help.txt';
  } else {
    var file = 'help-' + context + '.txt';
  }
  file = path.resolve(__dirname + '../../../doc/cli/' + file);
  debug('Help file is: ' + file);
  fs.readFile(file, { encoding: 'utf8'}, function (err, data) {
    if (err) { error.handle(new Error('ruche:module:help:readFile')) };
    debug('Help called for ' + context + ' context');
    emitter.emit('help', data);
  });
};

module.exports = help;<commit_msg>The call ruche.help() no longer require an argument<commit_after>// Module dependencies.
var debug = require('debug')('ruche:help');
var fs = require('fs');
var path = require('path');
var _ = require('underscore');
var emitter = require('./util/emitter');
var error = require('./util/error');
var valid = require('./util/valid');

/**
 * Show a contextual help.
 * @fires RucheEmitter#help
 * @param  {String} [context] Command you want to know more about.
 */
var help = function (context) {
  if (context === 'global' || _.isUndefined(context)) {
    var file = 'help.txt';
  } else {
    var file = 'help-' + context + '.txt';
  }
  file = path.resolve(__dirname + '../../../doc/cli/' + file);
  debug('Help file is: ' + file);
  fs.readFile(file, { encoding: 'utf8'}, function (err, data) {
    if (err) { error.handle(new Error('ruche:module:help:readFile')) };
    debug('Help called for ' + context + ' context');
    emitter.emit('help', data);
  });
};

module.exports = help;
{'fraction_non_alphanumeric': 0.20125786163522014, 'fraction_numerical': 0.0010482180293501049, 'mean_word_length': 3.7019704433497536, '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': '64027', 'n_tokens_mistral': 610, 'n_tokens_neox': 601, 'n_words': 171}