acryl 0.1.11 → 0.1.13
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/lib/bin.js +31 -2
- package/lib/bin.js.map +1 -1
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/lib/types/cli/grammar.d.ts +1 -0
- package/package.json +516 -3
package/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@ function parseAcrylArgs(args) {
|
|
|
25
25
|
let resumeSessionId;
|
|
26
26
|
let json = false;
|
|
27
27
|
let version = false;
|
|
28
|
+
let help = false;
|
|
28
29
|
for (let index = 0; index < args.length; index += 1) {
|
|
29
30
|
const argument = args[index];
|
|
30
31
|
if (argument === void 0) continue;
|
|
@@ -33,6 +34,11 @@ function parseAcrylArgs(args) {
|
|
|
33
34
|
version = true;
|
|
34
35
|
continue;
|
|
35
36
|
}
|
|
37
|
+
if (argument === "--help" || argument === "-h") {
|
|
38
|
+
if (help) throw new Error("--help may be provided only once");
|
|
39
|
+
help = true;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
36
42
|
if (argument === "--profile") {
|
|
37
43
|
if (profile !== void 0) throw new Error("--profile may be provided only once");
|
|
38
44
|
const value = args[index + 1];
|
|
@@ -64,15 +70,17 @@ function parseAcrylArgs(args) {
|
|
|
64
70
|
throw new Error(`unexpected argument for ${command}: ${argument}`);
|
|
65
71
|
}
|
|
66
72
|
const resolvedCommand = command ?? "tui";
|
|
67
|
-
if (!version && profile === void 0 && resumeSessionId === void 0) return {
|
|
73
|
+
if (!version && !help && profile === void 0 && resumeSessionId === void 0) return {
|
|
68
74
|
command: resolvedCommand,
|
|
69
75
|
json,
|
|
70
|
-
version
|
|
76
|
+
version,
|
|
77
|
+
help
|
|
71
78
|
};
|
|
72
79
|
return {
|
|
73
80
|
command: resolvedCommand,
|
|
74
81
|
json,
|
|
75
82
|
version,
|
|
83
|
+
help,
|
|
76
84
|
...profile === void 0 ? {} : { profile },
|
|
77
85
|
...resumeSessionId === void 0 ? {} : { resumeSessionId }
|
|
78
86
|
};
|