INNER CODE UNIT · JavaScript
checkArgs
clinicjs/node-clinic · bin.js:266
function checkArgs (toolname, args, help, version) {
if (args['--'] && args['--'].length >= 1 && !/^node(\.exe)?$/.test(path.basename(args['--'][0]))) {
console.error(`Clinic.js must be called with a \`node\` command line: \`clinic ${toolname} -- node script.js\`\n`)
printHelp(help, version)
process.exit(1)
}
}
function checkMetricsPermission (cb) {
/* istanbul ignore if: tracking intentionally disabled when running tests */
if (insight.optOut === undefined) {
return promisify(insight.askPermission).call(
insight,
'May Clinic.js report anonymous usage statistics to improve the tool over time?'
)
}
return Promise.resolve()