@thi.ng/args 2.9.2 → 2.10.0

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 (3) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/cli.js +8 -2
  3. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-08-06T18:02:31Z
3
+ - **Last updated**: 2025-09-04T09:11:23Z
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,12 @@ 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.10.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.10.0) (2025-09-04)
15
+
16
+ #### 🚀 Features
17
+
18
+ - update cliApp() to show current cmd info w/ usage ([2991527](https://github.com/thi-ng/umbrella/commit/2991527))
19
+
14
20
  ## [2.9.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.9.0) (2025-08-06)
15
21
 
16
22
  #### 🚀 Features
package/cli.js CHANGED
@@ -35,6 +35,12 @@ const cliApp = async (config) => {
35
35
  if (!cmd) {
36
36
  usageOpts.prefix += __descriptions(config.commands, usageOpts);
37
37
  __usageAndExit(config, usageOpts);
38
+ } else {
39
+ usageOpts.prefix += __descriptions(
40
+ { [cmdID]: cmd },
41
+ usageOpts,
42
+ "\nCurrent command:\n"
43
+ );
38
44
  }
39
45
  start++;
40
46
  }
@@ -84,12 +90,12 @@ const __usageAndExit = (config, usageOpts) => {
84
90
  process.stderr.write(usage(config.opts, usageOpts));
85
91
  process.exit(1);
86
92
  };
87
- const __descriptions = (commands, { color, lineWidth = 80 } = {}) => {
93
+ const __descriptions = (commands, { color, lineWidth = 80 } = {}, prefix = "\nAvailable commands:\n") => {
88
94
  const names = Object.keys(commands);
89
95
  const maxLength = Math.max(...names.map((x) => x.length));
90
96
  const theme = __colorTheme(color);
91
97
  return [
92
- "\nAvailable commands:\n",
98
+ prefix,
93
99
  ...names.map(
94
100
  (x) => `${__padRightAnsi(
95
101
  __ansi(x, theme.command),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/args",
3
- "version": "2.9.2",
3
+ "version": "2.10.0",
4
4
  "description": "Declarative, functional CLI argument/options parser, value coercions, sub-commands etc.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -39,17 +39,17 @@
39
39
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@thi.ng/api": "^8.12.1",
43
- "@thi.ng/checks": "^3.7.17",
44
- "@thi.ng/errors": "^2.5.41",
45
- "@thi.ng/logger": "^3.1.16",
46
- "@thi.ng/strings": "^3.9.21",
47
- "@thi.ng/text-format": "^2.2.40"
42
+ "@thi.ng/api": "^8.12.2",
43
+ "@thi.ng/checks": "^3.7.18",
44
+ "@thi.ng/errors": "^2.5.42",
45
+ "@thi.ng/logger": "^3.1.17",
46
+ "@thi.ng/strings": "^3.9.22",
47
+ "@thi.ng/text-format": "^2.2.41"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "^24.1.0",
51
- "esbuild": "^0.25.8",
52
- "typedoc": "^0.28.9",
50
+ "@types/node": "^24.3.0",
51
+ "esbuild": "^0.25.9",
52
+ "typedoc": "^0.28.12",
53
53
  "typescript": "^5.9.2"
54
54
  },
55
55
  "keywords": [
@@ -110,5 +110,5 @@
110
110
  "tag": "cli",
111
111
  "year": 2018
112
112
  },
113
- "gitHead": "f6ebc1302dc9211d588293aa0897173c6e54f4e5\n"
113
+ "gitHead": "5bda911600ff3c98232d0382a45c60ed0bd1a380\n"
114
114
  }