graphile-config
Version:
Standard plugin interface and helpers to be used across the Graphile stack.
31 lines (29 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCli = runCli;
exports.getTerminalWidth = getTerminalWidth;
const tslib_1 = require("tslib");
const yargs_1 = tslib_1.__importDefault(require("yargs"));
const helpers_1 = require("yargs/helpers");
function runCli(options, run) {
void _runCli(options, run).then(undefined, (e) => {
process.exitCode = 1;
console.error(e);
});
}
async function _runCli(options, run) {
const base = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv));
const argv = await options(base)
.strict()
.showHelpOnFail(false, "Specify --help for available options")
.epilogue(`\
Graphile's MIT-licensed Open Source Software is made possible thanks to support from our sponsors. To find out more about sponsorship, please visit:
💖 https://graphile.org/sponsor
Thank you for using our software.`)
.wrap(base.terminalWidth()).argv;
await run(argv);
}
function getTerminalWidth() {
return (0, yargs_1.default)().terminalWidth();
}
//# sourceMappingURL=cli.js.map