UNPKG

oazapfts

Version:

OpenApi TypeScript client generator

54 lines (52 loc) 1.22 kB
#!/usr/bin/env node import l from "fs"; import u from "minimist"; import { optsArgumentStyles as n, generateSource as a } from "./index.js"; const i = u(process.argv.slice(2), { alias: { i: "include", e: "exclude" }, boolean: ["optimistic", "useEnumType", "mergeReadWriteOnly", "useUnknown"], string: ["argumentStyle"] }); async function m(r, o, c) { const t = await a(r, c); o ? l.writeFileSync(o, t) : console.log(t); } const { include: g, exclude: p, optimistic: d, useEnumType: y, mergeReadWriteOnly: f, useUnknown: S, argumentStyle: e } = i, [s, x] = i._; s || (console.error(` Usage: oazapfts <spec> [filename] Options: --exclude, -e <tag to exclude> --include, -i <tag to include> --optimistic --useEnumType --useUnknown --mergeReadWriteOnly --argumentStyle=<${n.join(" | ")}> (default: positional) `), process.exit(1)); e !== void 0 && !n.includes(e) && (console.error( `--argumentStyle should be one of <${n.join( " | " )}>, but got "${e}"` ), process.exit(1)); m(s, x, { include: g, exclude: p, optimistic: d, useEnumType: y, useUnknown: S, mergeReadWriteOnly: f, argumentStyle: e }); //# sourceMappingURL=cli.js.map