"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
_Object$defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _commander = _interopRequireDefault(require("commander"));
var _index = require("../../cli-shared-utils/index.js");
var _default = (methodName, getLog) => {
  _commander.default.Command.prototype[methodName] = function (...args) {
    if (methodName === 'unknownOption' && this._allowUnknownOption) {
      return;
    }
    this.outputHelp();
    (0, _index.log)(`  ` + _index.chalk.red(getLog(...args)));
    (0, _index.log)();
    process.exit(1);
  };
};
exports.default = _default;