@thi.ng/args 2.7.0 → 2.7.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-07-10T20:04:18Z
3
+ - **Last updated**: 2025-07-11T08:24:44Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ### [2.7.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.7.1) (2025-07-11)
15
+
16
+ #### 🩹 Bug fixes
17
+
18
+ - update arg names in parse errors ([5e82c16](https://github.com/thi-ng/umbrella/commit/5e82c16))
19
+ - use kebab-case arg names
20
+
14
21
  ## [2.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.7.0) (2025-07-10)
15
22
 
16
23
  #### 🚀 Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/args",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Declarative, functional CLI argument/options parser, value coercions, sub-commands etc.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -110,5 +110,5 @@
110
110
  "tag": "cli",
111
111
  "year": 2018
112
112
  },
113
- "gitHead": "c6e23f650c9c5b35e1abb9c450a7eb67c5ab6a8e\n"
113
+ "gitHead": "cc6ab918acdac66990d04d6751d19c573a09730d\n"
114
114
  }
package/parse.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isArray } from "@thi.ng/checks/is-array";
2
2
  import { defError } from "@thi.ng/errors/deferror";
3
3
  import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
4
- import { camel } from "@thi.ng/strings/case";
4
+ import { camel, kebab } from "@thi.ng/strings/case";
5
5
  import { usage } from "./usage.js";
6
6
  import { __ansi, __colorTheme } from "./utils.js";
7
7
  const ParseError = defError(() => "parse error");
@@ -45,7 +45,7 @@ const __parseOpts = (specs, argv, opts) => {
45
45
  i++;
46
46
  }
47
47
  }
48
- id && illegalArgs(`missing value for: --${id}`);
48
+ id && illegalArgs(`missing value for: --${kebab(id)}`);
49
49
  return {
50
50
  result: __processResults(specs, acc),
51
51
  index: i,
@@ -94,7 +94,7 @@ const __processResults = (specs, acc) => {
94
94
  if (spec.default !== void 0) {
95
95
  acc[id] = spec.default;
96
96
  } else if (spec.optional === false) {
97
- illegalArgs(`missing arg: --${id}`);
97
+ illegalArgs(`missing arg: --${kebab(id)}`);
98
98
  }
99
99
  } else if (spec.coerce) {
100
100
  __coerceValue(spec, acc, id);
@@ -112,7 +112,7 @@ const __coerceValue = (spec, acc, id) => {
112
112
  }
113
113
  acc[id] = spec.coerce(acc[id]);
114
114
  } catch (e) {
115
- throw new Error(`arg --${id}: ${e.message}`);
115
+ throw new Error(`arg --${kebab(id)}: ${e.message}`);
116
116
  }
117
117
  };
118
118
  export {