@sdxc/cli 2026.11.3 → 2026.11.10

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/README.md CHANGED
@@ -141,6 +141,8 @@ Every token after the command's name, unparsed, to hand to another program.
141
141
  command({ arguments: { args: argument.rest() } }); // prog run users --help → ["users", "--help"]
142
142
  ```
143
143
 
144
+ A program with no commands can declare it on `commands({ arguments: { args: argument.rest() } })` and map a handler to the program itself, so it reads its whole command line, `--help` included.
145
+
144
146
  #### `flag.boolean(name, options?)`
145
147
 
146
148
  `--name`, and `--no-name` to turn it off.
package/dist/parse.js CHANGED
@@ -30,7 +30,7 @@ export function parseArgv(tree, argv, withVersion) {
30
30
  issues: [],
31
31
  };
32
32
  let index = 0;
33
- let rest = false;
33
+ let rest = tree.root.rest;
34
34
  /** Flag tokens read at a group, replayed against the member the command line goes on to name. */
35
35
  let atGroup = [];
36
36
  /** How many issues stood before the current group's flags were read. */
package/dist/tree.js CHANGED
@@ -67,8 +67,9 @@ export function buildTree(name, root) {
67
67
  args.push({ key, spec });
68
68
  });
69
69
  let rest = args.some((arg) => arg.spec.rest);
70
- if (rest && (isGroup(node) || flags.length > 0 || args.length !== 1)) {
71
- throw new Error(`${title}: argument.rest() is a command's only argument, with no flags`);
70
+ let nested = isGroup(node) && (path.length > 0 || Object.keys(groupSpec(node).members).length > 0);
71
+ if (rest && (nested || flags.length > 0 || args.length !== 1)) {
72
+ throw new Error(`${title}: argument.rest() is the only argument of a command, or of a program with no commands, with no flags`);
72
73
  }
73
74
  let entry = {
74
75
  node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/cli",
3
- "version": "2026.11.3",
3
+ "version": "2026.11.10",
4
4
  "description": "Build command-line tools with generated help, prompts bound to flags, tasks and a test harness",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,14 +14,14 @@
14
14
  "@standard-schema/spec": "^1.1.0"
15
15
  },
16
16
  "peerDependencies": {
17
- "remix": "3.1.0"
17
+ "remix": "3.2.0"
18
18
  },
19
19
  "peerDependenciesMeta": {
20
20
  "remix": {
21
21
  "optional": true
22
22
  }
23
23
  },
24
- "gitHead": "d1dd4030f8df68b8a170940a3f790ea8654d3676",
24
+ "gitHead": "6191b60a13885b1d826884d574c4a393f9b8eeee",
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },