genlayer 0.38.5 → 0.38.7

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/dist/index.js CHANGED
@@ -20078,7 +20078,7 @@ var require_cli_table3 = __commonJS({
20078
20078
  import { program } from "commander";
20079
20079
 
20080
20080
  // package.json
20081
- var version = "0.38.5";
20081
+ var version = "0.38.7";
20082
20082
  var package_default = {
20083
20083
  name: "genlayer",
20084
20084
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.38.5",
3
+ "version": "0.38.7",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -6,7 +6,7 @@ import { spawnSync } from 'node:child_process';
6
6
 
7
7
  function escapeMdx(text) {
8
8
  if (!text) return '';
9
- return String(text).replace(/</g, '&lt;').replace(/>/g, '&gt;');
9
+ return String(text).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\{/g, '\\{').replace(/\}/g, '\\}');
10
10
  }
11
11
 
12
12
  function formatArg(arg) {
@@ -119,12 +119,30 @@ function parseHelp(text, programName, commandPath) {
119
119
 
120
120
  if (inOptions) {
121
121
  // e.g., " -V, --version output the version number"
122
- const m = l.match(/^\s*(-\w)?,?\s*(--[\w-]+)?\s{2,}(.+)$/);
122
+ const m = l.match(/^\s*(-\w)?,?\s*(--[\w-]+(?:\s+<\w+>)?)\s{2,}(.+)$/);
123
123
  if (m) {
124
124
  const short = m[1] || '';
125
125
  const long = m[2] || '';
126
- const desc = m[3] || '';
127
- options.push({ short, long, description: desc, required: false });
126
+ let desc = m[3] || '';
127
+ let defaultValue = undefined;
128
+ const defaultMatch = desc.match(/\(default:\s*(.+?)\)\s*$/);
129
+ if (defaultMatch) {
130
+ defaultValue = defaultMatch[1].replace(/^["']|["']$/g, '');
131
+ desc = desc.replace(/\s*\(default:\s*.+?\)\s*$/, '').trim();
132
+ }
133
+ options.push({ short, long, description: desc, required: false, defaultValue });
134
+ } else if (options.length > 0 && /^\s{10,}/.test(l)) {
135
+ // Continuation line — append to previous option's description
136
+ const prev = options[options.length - 1];
137
+ let cont = l.trim();
138
+ const defaultMatch = cont.match(/\(default:\s*(.+?)\)\s*$/);
139
+ if (defaultMatch) {
140
+ prev.defaultValue = defaultMatch[1].replace(/^["']|["']$/g, '');
141
+ cont = cont.replace(/\s*\(default:\s*.+?\)\s*$/, '').trim();
142
+ }
143
+ if (cont) {
144
+ prev.description = prev.description ? `${prev.description} ${cont}` : cont;
145
+ }
128
146
  }
129
147
  } else if (inCommands) {
130
148
  // e.g., " deploy [options] Deploy intelligent contracts"