@cello-protocol/cli 0.0.19 → 0.0.20

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.
@@ -21,7 +21,9 @@ export type ArgsCheck = {
21
21
  };
22
22
  /**
23
23
  * F2: validate a subcommand's arguments BEFORE dispatch.
24
- * - --help / -h anywhere → help.
24
+ * - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
25
+ * follows an unknown flag or sits where --limit would consume its value — asking for
26
+ * help must never be masked by another argument error.
25
27
  * - any other dash-prefixed token the command does not recognize → unknown_flag
26
28
  * (never silently coerced into a positional).
27
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,cAAc,yHAUhB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAElF,eAAO,MAAM,KAAK,QAE0C,CAAC;AAiB7D,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAOD,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAWpE"}
1
+ {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,cAAc,yHAUhB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAElF,eAAO,MAAM,KAAK,QAE0C,CAAC;AAiB7D,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAOD,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAWpE"}
package/dist/cli-args.js CHANGED
@@ -41,16 +41,18 @@ const COMMAND_FLAGS = {
41
41
  };
42
42
  /**
43
43
  * F2: validate a subcommand's arguments BEFORE dispatch.
44
- * - --help / -h anywhere → help.
44
+ * - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
45
+ * follows an unknown flag or sits where --limit would consume its value — asking for
46
+ * help must never be masked by another argument error.
45
47
  * - any other dash-prefixed token the command does not recognize → unknown_flag
46
48
  * (never silently coerced into a positional).
47
49
  */
48
50
  export function checkArgs(command, args) {
51
+ if (args.some((a) => a === "--help" || a === "-h"))
52
+ return { kind: "help" };
49
53
  const known = COMMAND_FLAGS[command] ?? new Set();
50
54
  for (let i = 0; i < args.length; i++) {
51
55
  const arg = args[i];
52
- if (arg === "--help" || arg === "-h")
53
- return { kind: "help" };
54
56
  if (arg.startsWith("-")) {
55
57
  if (!known.has(arg))
56
58
  return { kind: "unknown_flag", flag: arg };
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,OAAO;IACP,QAAQ;I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AAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC5E,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,EAAU,CAAC;IAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;YAChE,IAAI,GAAG,KAAK,SAAS;gBAAE,CAAC,EAAE,CAAC,CAAC,qBAAqB;QACnD,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/cli",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -25,7 +25,7 @@
25
25
  "package.json"
26
26
  ],
27
27
  "dependencies": {
28
- "@cello-protocol/daemon": "0.0.21"
28
+ "@cello-protocol/daemon": "0.0.22"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^25.6.2"