Created
May 25, 2020 12:02
-
-
Save craigtaub/6e1a98e452422e364148b27ef41e812a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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