| 65253 | i3 && (Array.isArray(i3) ? a4.push(...i3) : a4.push(i3)); |
| 65254 | for (const s2 of a4) { |
| 65255 | if (r3.has(s2)) throw new Error(`Duplicate command name found: ${d3(s2)}`); |
| 65256 | r3.set(s2, n2); |
| 65257 | } |
| 65258 | } |
| 65259 | return r3.get(t2); |
| 65260 | } |
| 65261 | function Z2(t2, e3, r3 = process.argv.slice(2)) { |
| 65262 | if (!t2) throw new Error("Options is required"); |
| 65263 | if ("name" in t2 && (!t2.name || !y2.test(t2.name))) throw new Error(`Invalid script name: ${d3(t2.name)}`); |
| 65264 | const n2 = r3[0]; |
| 65265 | if (t2.commands && y2.test(n2)) { |
| 65266 | const a4 = z2(n2, t2.commands); |
| 65267 | if (a4) return x2(a4.options.name, { ...a4.options, parent: t2 }, a4.callback, r3.slice(1)); |