MCPcopy
hub / github.com/di-sukharev/opencommit / x2

Function x2

out/cli.cjs:65216–65242  ·  view source on GitHub ↗
(t2, e3, r3, n2)

Source from the content-addressed store, hash-verified

65214 if (o3 && (a4 = e3.length), s2 && (!f4 || o3 && f4.length === 0)) return console.error(`Error: Missing required parameter ${d3(i3)}
65215`), n2(), process.exit(1);
65216 t2[l3] = f4;
65217 }
65218}
65219function W2(t2) {
65220 return t2 === void 0 || t2 !== false;
65221}
65222function x2(t2, e3, r3, n2) {
65223 const a4 = { ...e3.flags }, i3 = e3.version;
65224 i3 && (a4.version = { type: Boolean, description: "Show version" });
65225 const { help: s2 } = e3, o3 = W2(s2);
65226 o3 && !("help" in a4) && (a4.help = { type: Boolean, alias: "h", description: "Show help" });
65227 const l3 = U(a4, n2, { ignore: e3.ignoreArgv }), f4 = () => {
65228 console.log(e3.version);
65229 };
65230 if (i3 && l3.flags.version === true) return f4(), process.exit(0);
65231 const p4 = new M2(), O5 = o3 && s2?.render ? s2.render : (c4) => p4.render(c4), u3 = (c4) => {
65232 const m5 = U3({ ...e3, ...c4 ? { help: c4 } : {}, flags: a4 });
65233 console.log(O5(m5, p4));
65234 };
65235 if (o3 && l3.flags.help === true) return u3(), process.exit(0);
65236 if (e3.parameters) {
65237 let { parameters: c4 } = e3, m5 = l3._;
65238 const g5 = c4.indexOf("--"), v5 = c4.slice(g5 + 1), h4 = /* @__PURE__ */ Object.create(null);
65239 if (g5 > -1 && v5.length > 0) {
65240 c4 = c4.slice(0, g5);
65241 const E4 = l3._["--"];
65242 m5 = m5.slice(0, -E4.length || void 0), b3(h4, w3(c4), m5, u3), b3(h4, w3(v5), E4, u3);
65243 } else b3(h4, w3(c4), m5, u3);
65244 Object.assign(l3._, h4);
65245 }

Callers 1

Z2Function · 0.85

Calls 10

W2Function · 0.85
UFunction · 0.85
f4Function · 0.85
u3Function · 0.85
b3Function · 0.85
w3Function · 0.85
r3Function · 0.85
renderMethod · 0.80
sliceMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected