easc 0.0.23 → 0.0.24
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/package.json +1 -1
- package/src/utils/cli.ts +12 -2
package/package.json
CHANGED
package/src/utils/cli.ts
CHANGED
|
@@ -173,10 +173,20 @@ class InteractiveCLI {
|
|
|
173
173
|
if (opt.default !== undefined) continue;
|
|
174
174
|
if (!opt.choices || !Array.isArray(opt.choices)) continue;
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
const selected = await select({
|
|
177
177
|
message: `Select ${key.replace(/-/g, " ")}:`,
|
|
178
|
-
choices:
|
|
178
|
+
choices: [
|
|
179
|
+
...opt.choices.map((c: string) => ({ name: c, value: c })),
|
|
180
|
+
{ name: "← Back", value: "__back__" },
|
|
181
|
+
],
|
|
179
182
|
});
|
|
183
|
+
|
|
184
|
+
if (selected === "__back__") {
|
|
185
|
+
this.args = [];
|
|
186
|
+
return this.parse();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
argv[key] = selected;
|
|
180
190
|
argv[camelKey] = argv[key];
|
|
181
191
|
}
|
|
182
192
|
}
|