viza 1.8.26 → 1.8.28

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.
@@ -61,17 +61,16 @@ export async function createProgram() {
61
61
  sub = new Command(name);
62
62
  sub.description(node.description || "");
63
63
  parent.addCommand(sub);
64
- // Bind positional arguments from descriptor
65
- if (node.args?.length) {
66
- for (const arg of node.args) {
67
- const syntax = arg.required
68
- ? `<${arg.name}>`
69
- : `[${arg.name}]`;
70
- // avoid duplicate arguments
71
- const exists = sub._args?.some((a) => a.name === arg.name);
72
- if (!exists) {
73
- sub.argument(syntax, arg.description);
74
- }
64
+ }
65
+ // Bind positional arguments from descriptor (must run even if sub already exists)
66
+ if (node.args?.length) {
67
+ for (const arg of node.args) {
68
+ const syntax = arg.required
69
+ ? `<${arg.name}>`
70
+ : `[${arg.name}]`;
71
+ const exists = sub._args?.some((a) => a.name === arg.name);
72
+ if (!exists) {
73
+ sub.argument(syntax, arg.description);
75
74
  }
76
75
  }
77
76
  }
@@ -117,8 +116,8 @@ export async function createProgram() {
117
116
  return merged;
118
117
  }
119
118
  const opts = collectOptions(cmd);
120
- const positionalArgs = args.slice(0, -1);
121
- await node.run(...positionalArgs, opts);
119
+ // NOTE: Use stable options-only execution (KISS)
120
+ await node.run(opts);
122
121
  });
123
122
  }
124
123
  if (node.children?.length) {
@@ -53,10 +53,12 @@ export function buildCommandTree() {
53
53
  parentNode.children.push(node);
54
54
  }
55
55
  }
56
- // leaf node → assign real handler
56
+ // leaf node → assign real handler + metadata
57
57
  if (i === parts.length - 1) {
58
58
  node.description = cmd.description;
59
59
  node.run = cmd.run;
60
+ node.options = cmd.options;
61
+ node.args = cmd.args;
60
62
  }
61
63
  parentNode = node;
62
64
  currentMap = node._childrenMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.8.26",
3
+ "version": "1.8.28",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {