Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
// @flow
require("../tools/entry");
require("@oclif/command")
.run()
.catch(require("@oclif/errors/handle"));
(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);
}
}
})();