"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Arg = Arg; var _lodash = require("lodash"); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ function Arg(config) { if (config.name === '_') throw Error('Arg names must not be _. Use it in aliases instead.'); this.name = config.name; this.required = config.required || false; this.help = config.help || ''; this.types = config.types || []; this.default = config.default; this.aliases = config.aliases || []; this.multi = config.multi == null ? false : config.multi; this.resolve = config.resolve == null ? true : config.resolve; this.options = config.options || []; this.accepts = type => { if (!this.types.length) return true; return (0, _lodash.includes)(config.types, type); }; }