mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-21 06:39:56 -06:00
15 lines
395 B
JavaScript
15 lines
395 B
JavaScript
const program = require('commander')
|
|
const { chalk } = require('@vue/cli-shared-utils')
|
|
|
|
module.exports = (methodName, log) => {
|
|
program.Command.prototype[methodName] = function (...args) {
|
|
if (methodName === 'unknownOption' && this._allowUnknownOption) {
|
|
return
|
|
}
|
|
this.outputHelp()
|
|
console.log(` ` + chalk.red(log(...args)))
|
|
console.log()
|
|
process.exit(1)
|
|
}
|
|
}
|