<commit_before>var Web3 = require('web3');

var Console = function(options) {
  this.plugins = options.plugins;
};

Console.prototype.runCode = function(code) {
  eval(code); // jshint ignore:line
};

Console.prototype.executeCmd = function(cmd, callback) {
  var plugin, pluginOutput;
  var plugins = this.plugins.getPluginsFor('console');
  for (var i = 0; i < plugins.length; i++) {
    plugin = plugins[i];
    pluginOutput = plugin.runCommands(cmd, {});
    if (pluginOutput !== false && pluginOutput !== 'false') return callback(pluginOutput);
  }

  if (cmd === 'help') {
    var helpText = [
      'Welcome to Embark 2',
      '',
      'possible commands are:',
      'quit - to immediatly exit',
      '',
      'The web3 object and the interfaces for the deployed contrats and their methods are also available'
    ];
    return callback(helpText.join('\n'));
  } else if (cmd === 'quit') {
    exit();
  }

  try {
    var result = eval(cmd); // jshint ignore:line
    return callback(result);
  }
  catch(e) {
    return callback(e.message.red);
  }
};
<commit_msg>advice user when an unknown command is typed in the console<commit_after>var Web3 = require('web3');

var Console = function(options) {
  this.plugins = options.plugins;
};

Console.prototype.runCode = function(code) {
  eval(code); // jshint ignore:line
};

Console.prototype.executeCmd = function(cmd, callback) {
  var plugin, pluginOutput;
  var plugins = this.plugins.getPluginsFor('console');
  for (var i = 0; i < plugins.length; i++) {
    plugin = plugins[i];
    pluginOutput = plugin.runCommands(cmd, {});
    if (pluginOutput !== false && pluginOutput !== 'false') return callback(pluginOutput);
  }

  if (cmd === 'help') {
    var helpText = [
      'Welcome to Embark 2',
      '',
      'possible commands are:',
      'quit - to immediatly exit',
      '',
      'The web3 object and the interfaces for the deployed contrats and their methods are also available'
    ];
    return callback(helpText.join('\n'));
  } else if (cmd === 'quit') {
    exit();
  }

  try {
    var result = eval(cmd); // jshint ignore:line
    return callback(result);
  }
  catch(e) {
    if (e.message.indexOf('not defined') > 0) {
      return callback(("error: " + e.message).red + ("\nType " + "help".bold + " to see the list of available commands").cyan);
    } else {
      return callback(e.message);
    }
  }
};

{'fraction_non_alphanumeric': 0.1524008350730689, 'fraction_numerical': 0.004592901878914405, 'mean_word_length': 3.1310344827586207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3985030', 'n_tokens_mistral': 757, 'n_tokens_neox': 747, 'n_words': 207}