@burnish/cli
Version:
a cli for creating vue / react / flutter projects
19 lines (18 loc) • 685 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = __importDefault(require("chalk"));
const enhanceErrorMessages = (program, methodName, log) => {
program.Command.prototype[methodName] = function (...args) {
if (methodName === 'unknownOption' && this._allowUnknownOption) {
return;
}
this.outputHelp();
console.log(' ' + chalk_1.default.red(log(...args)));
console.log();
process.exit(1);
};
};
exports.default = enhanceErrorMessages;