@letterstory/cli 0.176.79 → 0.176.80
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/cli.mjs +17 -4
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
86
86
|
|
|
87
87
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
88
|
-
export const VERSION = "0.176.
|
|
88
|
+
export const VERSION = "0.176.80";
|
|
89
89
|
|
|
90
90
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
91
91
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -274,9 +274,9 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
274
274
|
"resolve",
|
|
275
275
|
"reopen",
|
|
276
276
|
"skip",
|
|
277
|
-
// `phantom-onboard domain` / `admin create-org --onboard` switches.
|
|
277
|
+
// `phantom-onboard domain` / `admin create-org --onboard` switches. (`--status` is a switch only on
|
|
278
|
+
// phantom-onboard, SWITCH_FLAGS_BY_COMMAND: everywhere else it takes a value, `--status parked`.)
|
|
278
279
|
"watch",
|
|
279
|
-
"status",
|
|
280
280
|
"no-phantom",
|
|
281
281
|
"no-visuals",
|
|
282
282
|
"no-enhance",
|
|
@@ -424,6 +424,13 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
424
424
|
*/
|
|
425
425
|
const VALUE_FLAGS_BY_COMMAND = { automations: new Set(["on"]) };
|
|
426
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Flags that are switches on one command and take a value everywhere else. `--status` is "show me the job" on
|
|
429
|
+
* phantom-onboard (onboard.mjs), and a value on every other (`admin recipes save --status parked`, `admin crm
|
|
430
|
+
* prospect-orgs --status ready`): as a global switch, `--status parked` dropped "parked" (2026-11-09).
|
|
431
|
+
*/
|
|
432
|
+
export const SWITCH_FLAGS_BY_COMMAND = { "phantom-onboard": new Set(["status"]), onboard: new Set(["status"]) };
|
|
433
|
+
|
|
427
434
|
/**
|
|
428
435
|
* @param {string[]} argv
|
|
429
436
|
* @returns {{ positionals: string[], flags: Record<string, string | boolean | string[]> }}
|
|
@@ -432,6 +439,7 @@ export function parseArgs(argv) {
|
|
|
432
439
|
const positionals = [];
|
|
433
440
|
const flags = {};
|
|
434
441
|
const valueFlags = VALUE_FLAGS_BY_COMMAND[argv[0]] ?? new Set();
|
|
442
|
+
const switchFlags = SWITCH_FLAGS_BY_COMMAND[argv[0]] ?? new Set();
|
|
435
443
|
const setFlag = (name, value) => {
|
|
436
444
|
if (Object.prototype.hasOwnProperty.call(flags, name)) {
|
|
437
445
|
flags[name] = [].concat(flags[name], value);
|
|
@@ -452,7 +460,12 @@ export function parseArgs(argv) {
|
|
|
452
460
|
}
|
|
453
461
|
const name = tok.slice(2);
|
|
454
462
|
const next = argv[i + 1];
|
|
455
|
-
if (
|
|
463
|
+
if (
|
|
464
|
+
(BOOLEAN_FLAGS.has(name) && !valueFlags.has(name)) ||
|
|
465
|
+
switchFlags.has(name) ||
|
|
466
|
+
next === undefined ||
|
|
467
|
+
next.startsWith("--")
|
|
468
|
+
) {
|
|
456
469
|
flags[name] = true;
|
|
457
470
|
} else {
|
|
458
471
|
setFlag(name, next);
|