UNPKG

@cloud-copilot/cli

Version:

A standardized library for CLI building TypeScript CLI applications

25 lines 914 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.booleanArgument = booleanArgument; /** * Creates a boolean argument that is false by default and true if present. * * @param options the description and the single character that can be used to set the value to true * @returns a boolean argument */ function booleanArgument(options) { return { description: options.description, character: options.character, validateValues: (currentValue, value) => { if (value.length == 0) { return { valid: true, value: true }; } return { valid: false, message: `does not accept values but received ${value.join(', ')}` }; }, reduceValues: (current, newValue) => current, present: (currentValue) => true, defaultValue: false }; } //# sourceMappingURL=booleanArgument.js.map