Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save craigtaub/6e1a98e452422e364148b27ef41e812a to your computer and use it in GitHub Desktop.
Save craigtaub/6e1a98e452422e364148b27ef41e812a to your computer and use it in GitHub Desktop.
// lib cli/cli.js main()
const argv = process.argv.slice(2);
// lib/cli/options loadOptions()
var args = yargsParser.detailed(argv).argv;
args._ = Array.from(new Set(args._));
yargs()
.scriptName("our_mocha")
.command(commands.run)
.fail((msg, err, yargs) => {
yargs.showHelp();
const message = msg || err.message;
console.error(`\nERROR: ${message}`);
process.exit(1);
})
.help("help", "Show usage information & exit")
.version("version", "Show version number & exit", "1.0")
.epilog("Mocha Resources: ...")
.config(args)
.parse(args._);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment