@trenskow/arguments-parser 0.3.92 → 0.3.94

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.
Files changed (2) hide show
  1. package/lib/index.js +9 -7
  2. package/package.json +4 -4
package/lib/index.js CHANGED
@@ -166,7 +166,8 @@ const argumentsParser = (
166
166
  strings,
167
167
  options,
168
168
  parameters
169
- })
169
+ }),
170
+ parameters
170
171
  });
171
172
 
172
173
  } catch (error) {
@@ -195,7 +196,7 @@ const argumentsParser = (
195
196
  }${
196
197
  Array.isArray(command.parameters) ? ` ${
197
198
  command.parameters
198
- .map((parameter) => `${opening}${parameter}${closing}`)
199
+ .map((parameter) => `${opening}${caseit(parameter, 'kebab')}${closing}`)
199
200
  .join(' ')
200
201
  }` : ''
201
202
  }`,
@@ -287,8 +288,8 @@ const argumentsParser = (
287
288
  validationOptions);
288
289
 
289
290
  options.schema = merge(
290
- options.schema)
291
- .with(schema);
291
+ schema)
292
+ .with(options.schema);
292
293
 
293
294
  return result;
294
295
 
@@ -356,10 +357,11 @@ const argumentsParser = (
356
357
  const keyPathSchema = keyPaths(options.schema).get(keyPath);
357
358
 
358
359
  let optionKeys = [`--${caseit(keyPath, 'kebab')}`];
360
+
359
361
  let description = [keyPathSchema.description || strings?.commands?.help?.noDescription || 'No description'];
360
362
 
361
- if (shortOptions[keyPath]) {
362
- optionKeys.push(`-${shortOptions[keyPath]}`);
363
+ if (keyPathSchema.short) {
364
+ optionKeys.push(`-${keyPathSchema.short}`);
363
365
  }
364
366
 
365
367
  if (typeof keyPathSchema.enum !== 'undefined') {
@@ -494,7 +496,7 @@ const argumentsParser = (
494
496
  printHelp(error);
495
497
  }
496
498
 
497
- return Object.assign({}, parameters, data, {
499
+ return Object.assign({}, data, {
498
500
  onError: (error) => {
499
501
  print.err(error.message);
500
502
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/arguments-parser",
3
- "version": "0.3.92",
3
+ "version": "0.3.94",
4
4
  "description": "Yet another arguments parser.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,13 +25,13 @@
25
25
  "homepage": "https://github.com/trenskow/arguments-parser#readme",
26
26
  "dependencies": {
27
27
  "@trenskow/caseit": "^1.4.24",
28
- "@trenskow/print": "^0.1.58",
29
- "isvalid": "^5.0.5"
28
+ "@trenskow/print": "^0.1.59",
29
+ "isvalid": "^5.0.6"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@eslint/eslintrc": "^3.3.5",
33
33
  "@eslint/js": "^10.0.1",
34
- "eslint": "^10.4.0",
34
+ "eslint": "^10.4.1",
35
35
  "globals": "^17.6.0"
36
36
  }
37
37
  }