convoker 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 trailfrost
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # LunarCLI
2
+
3
+ A simple, type safe CLI library for TypeScript.
4
+
5
+ ```ts
6
+ import { i, Command } from "lunarcli";
7
+
8
+ const program = new Command("calc").description("A basic calculator.");
9
+
10
+ program
11
+ .subCommand("add", (c) =>
12
+ c
13
+ .description("Adds two numbers.")
14
+ .input({
15
+ x: i.option("number", "-x", "--x"),
16
+ y: i.option("number", "-y", "--y"),
17
+ })
18
+ .action(({ x, y }) => {
19
+ console.log(`${x} + ${y} = ${x + y}`);
20
+ }),
21
+ )
22
+ .subCommand("sub", (c) =>
23
+ c
24
+ .description("Subtracts any amount of numbers.")
25
+ .input({
26
+ numbers: i.option("number", "--numbers", "-n").list(),
27
+ })
28
+ .action(({ numbers }) => {
29
+ const sub = numbers.reduce((a, b) => a - b, 0);
30
+ console.log(`${numbers.join(" + ")} = ${sub}`);
31
+ }),
32
+ )
33
+ .run();
34
+ ```
@@ -0,0 +1,80 @@
1
+ import { i as c } from "./utils-DdmSEjLc.js";
2
+ async function d(e = "", t, u) {
3
+ if (c) {
4
+ await Deno.stdout.write(new TextEncoder().encode(e));
5
+ const a = new TextDecoder(), i = new Uint8Array(1024);
6
+ let n = "";
7
+ for (; ; ) {
8
+ const o = await Deno.stdin.read(i);
9
+ if (!o) break;
10
+ const s = a.decode(i.subarray(0, o));
11
+ if (s.includes(`
12
+ `)) {
13
+ n += s.split(`
14
+ `)[0];
15
+ break;
16
+ }
17
+ n += s;
18
+ }
19
+ return n.trim() || t || "";
20
+ }
21
+ const r = await Promise.resolve().then(() => x);
22
+ return new Promise((a) => {
23
+ const i = r.createInterface({
24
+ input: process.stdin,
25
+ output: process.stdout,
26
+ terminal: !0
27
+ });
28
+ if (u?.masked) {
29
+ const n = i._writeToOutput.bind(i);
30
+ i._writeToOutput = (o) => {
31
+ if (o.match(/^\x1b/) || o.endsWith(`
32
+ `) || o.endsWith("\r")) return n(o);
33
+ const s = u.maskChar ?? "*";
34
+ n(s.repeat(o.length));
35
+ };
36
+ }
37
+ i.question(e, (n) => {
38
+ i.close(), a(n || t || "");
39
+ });
40
+ });
41
+ }
42
+ async function f() {
43
+ return new Promise((e) => {
44
+ const t = process.stdin;
45
+ t.setRawMode(!0), t.resume(), t.once("data", (u) => {
46
+ const r = u.toString();
47
+ return t.setRawMode(!1), t.pause(), e(r === "\r" || r === `
48
+ ` ? "enter" : r === " " ? "space" : r === "\x1B[A" ? "up" : r === "\x1B[B" ? "down" : r === "\x1B[C" ? "right" : r === "\x1B[D" ? "left" : r);
49
+ });
50
+ });
51
+ }
52
+ function p(e = 1) {
53
+ for (let t = 0; t < e; t++) process.stdout.write("\x1B[2K\x1B[1A");
54
+ process.stdout.write("\x1B[2K\r");
55
+ }
56
+ function w(e = 1) {
57
+ process.stdout.write(`\x1B[${e}A`);
58
+ }
59
+ function l(e = 1) {
60
+ process.stdout.write(`\x1B[${e}B`);
61
+ }
62
+ const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
63
+ __proto__: null,
64
+ clearLines: p,
65
+ cursorDown: l,
66
+ cursorUp: w,
67
+ readKey: f,
68
+ readLine: d
69
+ }, Symbol.toStringTag, { value: "Module" })), x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
70
+ __proto__: null
71
+ }, Symbol.toStringTag, { value: "Module" }));
72
+ export {
73
+ x as _,
74
+ f as a,
75
+ w as b,
76
+ p as c,
77
+ m as d,
78
+ l as e,
79
+ d as r
80
+ };
@@ -0,0 +1,153 @@
1
+ import { m as p } from "./utils-DdmSEjLc.js";
2
+ function m() {
3
+ if (typeof window < "u" && typeof window.document < "u")
4
+ return !1;
5
+ const e = typeof process < "u" ? process.env ?? {} : {};
6
+ if ("NO_COLOR" in e) return !1;
7
+ if ("FORCE_COLOR" in e) return !0;
8
+ if ("CI" in e)
9
+ return !!([
10
+ "TRAVIS",
11
+ "CIRCLECI",
12
+ "APPVEYOR",
13
+ "GITLAB_CI",
14
+ "GITHUB_ACTIONS",
15
+ "BUILDKITE",
16
+ "DRONE"
17
+ ].some((t) => t in e) || e.CI_NAME === "codeship");
18
+ if (typeof Deno < "u" && Deno.noColor !== void 0)
19
+ return !Deno.noColor;
20
+ if (typeof process < "u" && process.stdout) {
21
+ const t = e.TERM || "";
22
+ return (e.COLORTERM || "").length > 0 ? !0 : t === "dumb" ? !1 : /(color|ansi|cygwin|xterm|vt100)/i.test(t);
23
+ }
24
+ return !1;
25
+ }
26
+ const c = m();
27
+ function s(e, t) {
28
+ const n = `\x1B[${e}m`, r = `\x1B[${t}m`;
29
+ return c ? (o) => {
30
+ if (!o) return n + r;
31
+ const B = (o + "").replace(
32
+ new RegExp(`\x1B\\[${t}m`, "g"),
33
+ r + n
34
+ );
35
+ return n + B + r;
36
+ } : (o) => o + "";
37
+ }
38
+ const y = s(0, 0), a = s(1, 22), C = s(2, 22), i = s(3, 23), g = s(4, 24), w = s(53, 55), O = s(7, 27), R = s(8, 28), E = s(9, 29), I = s(30, 39), l = s(31, 39), u = s(32, 39), d = s(33, 39), T = s(34, 39), _ = s(35, 39), f = s(36, 39), v = s(37, 39), b = s(90, 39), A = s(40, 49), L = s(41, 49), M = s(42, 49), x = s(43, 49), D = s(44, 49), G = s(45, 49), S = s(46, 49), N = s(47, 49), k = s(100, 49), P = s(91, 39), j = s(92, 39), F = s(93, 39), H = s(94, 39), U = s(95, 39), Y = s(96, 39), $ = s(97, 39), z = s(101, 49), K = s(102, 49), V = s(103, 49), W = s(104, 49), q = s(105, 49), J = s(106, 49), Q = s(107, 49), h = {
39
+ primary: f,
40
+ secondary: b,
41
+ success: u,
42
+ warning: d,
43
+ error: l,
44
+ symbols: {
45
+ success: "✔",
46
+ error: "✖",
47
+ warning: "⚠"
48
+ },
49
+ styles: {
50
+ bold: a,
51
+ italic: i,
52
+ underline: g
53
+ }
54
+ };
55
+ function X(e) {
56
+ return p(h, e);
57
+ }
58
+ const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
59
+ __proto__: null,
60
+ DEFAULT_THEME: h,
61
+ bgBlack: A,
62
+ bgBlue: D,
63
+ bgBlueBright: W,
64
+ bgCyan: S,
65
+ bgCyanBright: J,
66
+ bgGray: k,
67
+ bgGreen: M,
68
+ bgGreenBright: K,
69
+ bgMagenta: G,
70
+ bgMagentaBright: q,
71
+ bgRed: L,
72
+ bgRedBright: z,
73
+ bgWhite: N,
74
+ bgWhiteBright: Q,
75
+ bgYellow: x,
76
+ bgYellowBright: V,
77
+ black: I,
78
+ blue: T,
79
+ blueBright: H,
80
+ bold: a,
81
+ createAnsiColor: s,
82
+ cyan: f,
83
+ cyanBright: Y,
84
+ defineTheme: X,
85
+ dim: C,
86
+ gray: b,
87
+ green: u,
88
+ greenBright: j,
89
+ hidden: R,
90
+ inverse: O,
91
+ italic: i,
92
+ magenta: _,
93
+ magentaBright: U,
94
+ overline: w,
95
+ red: l,
96
+ redBright: P,
97
+ reset: y,
98
+ strikethrough: E,
99
+ supportsColor: c,
100
+ underline: g,
101
+ white: v,
102
+ whiteBright: $,
103
+ yellow: d,
104
+ yellowBright: F
105
+ }, Symbol.toStringTag, { value: "Module" }));
106
+ export {
107
+ G as A,
108
+ S as B,
109
+ N as C,
110
+ h as D,
111
+ k as E,
112
+ P as F,
113
+ j as G,
114
+ F as H,
115
+ H as I,
116
+ U as J,
117
+ Y as K,
118
+ $ as L,
119
+ z as M,
120
+ K as N,
121
+ V as O,
122
+ W as P,
123
+ q as Q,
124
+ J as R,
125
+ Q as S,
126
+ X as T,
127
+ es as a,
128
+ a as b,
129
+ f as c,
130
+ s as d,
131
+ C as e,
132
+ O as f,
133
+ b as g,
134
+ R as h,
135
+ i,
136
+ E as j,
137
+ I as k,
138
+ l,
139
+ u as m,
140
+ T as n,
141
+ w as o,
142
+ _ as p,
143
+ A as q,
144
+ y as r,
145
+ c as s,
146
+ L as t,
147
+ g as u,
148
+ M as v,
149
+ v as w,
150
+ x,
151
+ d as y,
152
+ D as z
153
+ };
@@ -0,0 +1,95 @@
1
+ class n extends Error {
2
+ /**
3
+ * Creates a new input validation error.
4
+ * @param messages The messages.
5
+ */
6
+ constructor(r) {
7
+ super(`Validation failed: ${r.join(", ")}`), this.messages = r;
8
+ }
9
+ }
10
+ class o extends Error {
11
+ /**
12
+ * Creates a new LunarCLI error.
13
+ * @param message The message.
14
+ * @param command The command.
15
+ */
16
+ constructor(r, s) {
17
+ super(r), this.command = s;
18
+ }
19
+ /**
20
+ * Prints the error's message.
21
+ */
22
+ print() {
23
+ console.error(this.message);
24
+ }
25
+ }
26
+ class i extends o {
27
+ /**
28
+ * Creates a new help asked error.
29
+ * @param command The command.
30
+ */
31
+ constructor(r) {
32
+ super("user asked for help!", r);
33
+ }
34
+ }
35
+ class a extends o {
36
+ /**
37
+ * Creates a new too many arguments error.
38
+ * @param command The command.
39
+ */
40
+ constructor(r) {
41
+ super("too many arguments!", r);
42
+ }
43
+ }
44
+ class u extends o {
45
+ /**
46
+ * Creates a new unknown option error.
47
+ * @param command The command.
48
+ * @param key The key.
49
+ */
50
+ constructor(r, s) {
51
+ super(`unknown option: ${s}!`, r), this.key = s;
52
+ }
53
+ }
54
+ class c extends o {
55
+ /**
56
+ * Creates a new missing required option error.
57
+ * @param command The command.
58
+ * @param key The key.
59
+ * @param entry The entry.
60
+ */
61
+ constructor(r, s, t) {
62
+ super(`missing required option: ${s}!`, r), this.key = s, this.entry = t;
63
+ }
64
+ }
65
+ class d extends o {
66
+ /**
67
+ * Creates a new missing required argument error.
68
+ * @param command The command.
69
+ * @param key The key.
70
+ * @param entry The entry.
71
+ */
72
+ constructor(r, s, t) {
73
+ super(`missing required positional argument: ${s}!`, r), this.key = s, this.entry = t;
74
+ }
75
+ }
76
+ const l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
77
+ __proto__: null,
78
+ HelpAskedError: i,
79
+ InputValidationError: n,
80
+ LunarCLIError: o,
81
+ MissingRequiredArgumentError: d,
82
+ MissingRequiredOptionError: c,
83
+ TooManyArgumentsError: a,
84
+ UnknownOptionError: u
85
+ }, Symbol.toStringTag, { value: "Module" }));
86
+ export {
87
+ i as H,
88
+ n as I,
89
+ o as L,
90
+ c as M,
91
+ a as T,
92
+ u as U,
93
+ d as a,
94
+ l as e
95
+ };
@@ -0,0 +1,198 @@
1
+ import { D as y } from "./color-CiruG_zQ.js";
2
+ import { v as p } from "./standard-schema-Dn3nwAxU.js";
3
+ import { I as f } from "./error-Cj2qDfOl.js";
4
+ import { i as $, a as v, b } from "./utils-DdmSEjLc.js";
5
+ import { r as m, a as g, c as d, b as x, d as D } from "./__vite-browser-external-DQYBmsno.js";
6
+ let l = y;
7
+ function E(e) {
8
+ l = e;
9
+ }
10
+ async function L(e) {
11
+ const n = (e.theme ?? l).primary(e.message) + " ", t = await m(n, e.default);
12
+ if (e.minLength && t.length < e.minLength)
13
+ throw new f([
14
+ `Must be at least ${e.minLength} characters`
15
+ ]);
16
+ if (e.maxLength && t.length > e.maxLength)
17
+ throw new f([
18
+ `Must be at most ${e.maxLength} characters`
19
+ ]);
20
+ if (typeof e.validate == "function") {
21
+ if (!e.validate(t))
22
+ throw new f([
23
+ "Validation function returned a falsy value"
24
+ ]);
25
+ } else e.validate && p(e.validate, t);
26
+ return t;
27
+ }
28
+ async function I(e) {
29
+ const a = e.theme ?? l, n = await m(a.primary(e.message) + " ", void 0, {
30
+ masked: !0,
31
+ maskChar: e.mask ?? "*"
32
+ });
33
+ if (e.confirm) {
34
+ const t = await m(
35
+ a.secondary("Confirm password: "),
36
+ void 0,
37
+ {
38
+ masked: !0,
39
+ maskChar: e.mask ?? "*"
40
+ }
41
+ );
42
+ if (n !== t) throw new Error(a.error("Passwords do not match"));
43
+ }
44
+ return n;
45
+ }
46
+ async function k(e) {
47
+ const a = e.theme ?? l, n = e.options;
48
+ let t = e.initialIndex ?? 0;
49
+ const i = () => {
50
+ d(n.length + 1), console.log(a.primary(e.message));
51
+ for (let s = 0; s < n.length; s++) {
52
+ const r = n[s], c = s === t ? a.accent?.("> ") ?? "> " : " ", o = r.disabled ? a.secondary(r.label) : a.foreground?.(r.label) ?? r.label;
53
+ console.log(c + o);
54
+ }
55
+ };
56
+ for (console.log(a.primary(e.message)), n.forEach(
57
+ (s, r) => console.log(`${r === t ? "> " : " "}${s.label}`)
58
+ ); ; ) {
59
+ const s = await g();
60
+ if (s === "up" && t > 0) t--;
61
+ else if (s === "down" && t < n.length - 1) t++;
62
+ else if (s === "enter") {
63
+ const r = n[t];
64
+ if (r.disabled) continue;
65
+ return d(n.length + 1), console.log(a.success(`${a.symbols?.success ?? "✔"} ${r.label}`)), r.value;
66
+ }
67
+ i();
68
+ }
69
+ }
70
+ async function T(e) {
71
+ const a = e.theme ?? l, n = e.options;
72
+ let t = e.initialIndex ?? 0;
73
+ const i = /* @__PURE__ */ new Set(), s = () => {
74
+ d(), console.log(a.primary(e.message)), n.forEach((r, c) => {
75
+ const o = c === t ? a.accent?.("> ") ?? "> " : " ", u = i.has(c) ? a.success("[x]") : "[ ]";
76
+ console.log(o + u + " " + r.label);
77
+ });
78
+ };
79
+ for (s(); ; ) {
80
+ const r = await g();
81
+ if (r === "up" && t > 0) t--;
82
+ else if (r === "down" && t < n.length - 1) t++;
83
+ else if (r === "space")
84
+ i.has(t) ? i.delete(t) : i.add(t);
85
+ else if (r === "return") {
86
+ const c = Array.from(i).map((o) => n[o].value);
87
+ return d(n.length + 1), console.log(a.success(`${e.message} ${c.length} selected`)), c;
88
+ }
89
+ x(n.length), s();
90
+ }
91
+ }
92
+ async function _(e) {
93
+ const a = e.theme ?? l;
94
+ let n = "";
95
+ const t = e.filter ?? ((i, s) => s.label.toLowerCase().includes(i.toLowerCase()));
96
+ for (; ; ) {
97
+ d(), console.log(a.primary(e.message));
98
+ const i = e.options.filter((r) => t(n, r));
99
+ i.forEach(
100
+ (r) => console.log(" " + (a.foreground?.(r.label) ?? r.label))
101
+ );
102
+ const s = await m(a.secondary(`Search: ${n}`));
103
+ if (s !== "" && (n = s, i.length === 1))
104
+ return i[0].value;
105
+ }
106
+ }
107
+ async function C(e) {
108
+ const a = e.theme ?? l, n = e.yesLabel ?? "y", t = e.noLabel ?? "n", i = e.default ? n : t, s = await m(
109
+ `${a.primary(e.message)} ${a.secondary(`[${n}/${t}] (default: ${i})`)} `
110
+ );
111
+ return s ? /^y/i.test(s.trim()) : !!e.default;
112
+ }
113
+ async function F(e) {
114
+ const a = e.theme ?? {
115
+ primary: (n) => n,
116
+ secondary: (n) => n
117
+ };
118
+ console.log(a.primary(e.message ?? "Please enter text:")), console.log(a.secondary("Press Ctrl+D (or save & close editor) when done."));
119
+ try {
120
+ const n = await P(e.initial ?? "");
121
+ if (e.required && !n.trim()) throw new Error("Input required.");
122
+ return n;
123
+ } catch {
124
+ const n = await m("", e.initial, {});
125
+ if (e.required && !n.trim()) throw new Error("Input required.");
126
+ return n;
127
+ }
128
+ }
129
+ async function P(e) {
130
+ const a = `edit-${Date.now()}.txt`;
131
+ if ($) {
132
+ const t = `${Deno.env.get("TMPDIR") ?? "/tmp"}/${a}`;
133
+ await Deno.writeTextFile(t, e ?? "");
134
+ const i = Deno.env.get("EDITOR") ?? "vi", r = await new Deno.Command(i, {
135
+ args: [t],
136
+ stdin: "inherit",
137
+ stdout: "inherit",
138
+ stderr: "inherit"
139
+ }).spawn().status;
140
+ if (!r.success)
141
+ throw new Error(`${i} exited with ${r.code}`);
142
+ const c = await Deno.readTextFile(t);
143
+ return await Deno.remove(t).catch(() => {
144
+ }), c;
145
+ }
146
+ if (v) {
147
+ const { $: n } = await import("bun"), t = `/tmp/${a}`;
148
+ await Bun.write(t, e ?? "");
149
+ const i = process.env.EDITOR ?? "vi";
150
+ await n`${i} ${t}`;
151
+ const s = await Bun.file(t).text();
152
+ return await Bun.write(t, ""), s;
153
+ }
154
+ if (b) {
155
+ const { tmpdir: n } = await import("./__vite-browser-external-DQYBmsno.js").then((o) => o._), { join: t } = await import("./__vite-browser-external-DQYBmsno.js").then((o) => o._), { promises: i } = await import("./__vite-browser-external-DQYBmsno.js").then((o) => o._), { spawn: s } = await import("./__vite-browser-external-DQYBmsno.js").then((o) => o._), r = t(n(), a);
156
+ await i.writeFile(r, e ?? "", "utf8");
157
+ const c = process.env.EDITOR || process.env.VISUAL || (process.platform === "win32" ? "notepad" : "vi");
158
+ return new Promise((o, u) => {
159
+ s(c, [r], { stdio: "inherit" }).on("exit", async (w) => {
160
+ if (w !== 0) {
161
+ u(new Error(`${c} exited with code ${w}`));
162
+ return;
163
+ }
164
+ try {
165
+ const h = await i.readFile(r, "utf8");
166
+ await i.unlink(r).catch(() => {
167
+ }), o(h);
168
+ } catch (h) {
169
+ u(h);
170
+ }
171
+ });
172
+ });
173
+ }
174
+ throw new Error("Unsupported runtime for system editor.");
175
+ }
176
+ const U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
177
+ __proto__: null,
178
+ confirm: C,
179
+ editor: F,
180
+ multiselect: T,
181
+ password: I,
182
+ raw: D,
183
+ search: _,
184
+ select: k,
185
+ setTheme: E,
186
+ text: L
187
+ }, Symbol.toStringTag, { value: "Module" }));
188
+ export {
189
+ k as a,
190
+ _ as b,
191
+ C as c,
192
+ F as e,
193
+ U as i,
194
+ T as m,
195
+ I as p,
196
+ E as s,
197
+ L as t
198
+ };
@@ -0,0 +1,135 @@
1
+ import { v as u } from "./standard-schema-Dn3nwAxU.js";
2
+ async function o(r, t) {
3
+ if (typeof r == "string")
4
+ switch (r) {
5
+ case "boolean":
6
+ return t === "true";
7
+ case "bigint":
8
+ return BigInt(t);
9
+ case "number":
10
+ return parseFloat(t);
11
+ case "string":
12
+ return t;
13
+ }
14
+ return u(r, t);
15
+ }
16
+ class i {
17
+ /**
18
+ * Creates a new option.
19
+ * @param kind The type of this option.
20
+ * @param names The names of this option.
21
+ */
22
+ constructor(t, s) {
23
+ this.$required = !0, this.$list = !1, this.$kind = t, this.$names = s.map((n) => n.replace(/^-+/, ""));
24
+ }
25
+ /**
26
+ * Makes this option a list.
27
+ * @returns this
28
+ */
29
+ list() {
30
+ return this.$list = !0, this;
31
+ }
32
+ /**
33
+ * Makes this option required.
34
+ * @returns this
35
+ */
36
+ required() {
37
+ return this.$required = !0, this;
38
+ }
39
+ /**
40
+ * Makes this option optional.
41
+ * @returns this
42
+ */
43
+ optional() {
44
+ return this.$required = !1, this;
45
+ }
46
+ /**
47
+ * Sets a default value.
48
+ * @param value The default value.
49
+ * @returns this
50
+ */
51
+ default(t) {
52
+ return this.$default = t, this;
53
+ }
54
+ /**
55
+ * Sets a description.
56
+ * @param desc The description.
57
+ * @returns this
58
+ */
59
+ description(t) {
60
+ return this.$description = t, this;
61
+ }
62
+ }
63
+ class e {
64
+ /**
65
+ * Creates a new positional argument.
66
+ * @param kind The positional argument.
67
+ */
68
+ constructor(t) {
69
+ this.$required = !0, this.$list = !1, this.$kind = t;
70
+ }
71
+ /**
72
+ * Makes this argument a list.
73
+ * @returns this
74
+ */
75
+ list() {
76
+ return this.$list = !0, this;
77
+ }
78
+ /**
79
+ * Makes this argument required.
80
+ * @returns this
81
+ */
82
+ required() {
83
+ return this.$required = !0, this;
84
+ }
85
+ /**
86
+ * Makes this argument optional.
87
+ * @returns this
88
+ */
89
+ optional() {
90
+ return this.$required = !1, this;
91
+ }
92
+ /**
93
+ * Sets a default value.
94
+ * @param value The default value.
95
+ * @returns this
96
+ */
97
+ default(t) {
98
+ return this.$default = t, this;
99
+ }
100
+ /**
101
+ * Sets a description.
102
+ * @param desc The description.
103
+ * @returns this
104
+ */
105
+ description(t) {
106
+ return this.$description = t, this;
107
+ }
108
+ }
109
+ function a(r, ...t) {
110
+ return new i(r, t);
111
+ }
112
+ function h(r) {
113
+ return new e(r);
114
+ }
115
+ function c(r) {
116
+ return new e(r);
117
+ }
118
+ const d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
119
+ __proto__: null,
120
+ Option: i,
121
+ Positional: e,
122
+ argument: c,
123
+ convert: o,
124
+ option: a,
125
+ positional: h
126
+ }, Symbol.toStringTag, { value: "Module" }));
127
+ export {
128
+ i as O,
129
+ e as P,
130
+ c as a,
131
+ o as c,
132
+ d as i,
133
+ a as o,
134
+ h as p
135
+ };