How to use the @oclif/command.run function in @oclif/command

To help you get started, we’ve selected a few @oclif/command 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 adobe / aio-cli / src / index.js View on Github external
if (firstFlag < 0) {
    firstFlag = argv.length
  }
  // 2. try to make the biggest topic command by combining with ':'
  // and looking up in this.config.commandIDs
  for (let x = firstFlag; x > -1; x--) {
    subCommand = argv.slice(0, x).join(':')
    // if (config.findTopic(subCommand)) { // <= this works but does not support aliases
    if (config.findCommand(subCommand)) {
      argv = [subCommand].concat(argv.slice(x))
      break
    }
  }

  // the second parameter is the root path to the CLI containing the command
  return run(argv, config.options)
}
github sourcecred / sourcecred / src / oclif / sourcecred.js View on Github external
// @flow
require("../tools/entry");
require("@oclif/command")
  .run()
  .catch(require("@oclif/errors/handle"));
github apifytech / apify-cli / src / bin.js View on Github external
(async () => {
    try {
        await require('@oclif/command').run()
    } catch (err) {
        const exitCode = (err.oclif && err.oclif.exit !== undefined) ? err.oclif.exit : 1;
        if (exitCode !== 0) {
            outputs.error(err.message);
            if (process.env.DEBUG) console.error(err);
        }
    }
})();