How to use the inquirer.registerCommand function in inquirer

To help you get started, we’ve selected a few inquirer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bhagn / simple-shell / index.js View on Github external
var banner = figlet.textSync((options.name || pkg.name).toUpperCase(), {
      font: 'Small',
      horizontalLayout: 'default',
      verticalLayout: 'default'
    });

    var meta = ['Copyright(c) ',
      (new Date().getFullYear()), ', ',
      (options.author || pkg.author.name),
      ' | Version: ',
      (options.version || pkg.version), '\n'].join('');

    console.log(banner.red);
    console.log(meta.gray);

    SimpleShell.registerCommand({
      name: 'help',
      help: 'Show this help menu',
      handler: helpHandler
    });

    SimpleShell.registerCommand({
      name: 'exit',
      help: 'Exit the console',
      handler: function() {
        rl.close();
      }
    });
  }