viza 1.8.25 → 1.8.26

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,6 +61,19 @@ 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
+ }
75
+ }
76
+ }
64
77
  }
65
78
  // Bind global CLI options to every command (Commander does not inherit options)
66
79
  for (const opt of getGlobalOptions()) {
@@ -104,7 +117,8 @@ export async function createProgram() {
104
117
  return merged;
105
118
  }
106
119
  const opts = collectOptions(cmd);
107
- await node.run(opts);
120
+ const positionalArgs = args.slice(0, -1);
121
+ await node.run(...positionalArgs, opts);
108
122
  });
109
123
  }
110
124
  if (node.children?.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.8.25",
3
+ "version": "1.8.26",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {