@trenskow/arguments-parser 0.3.77 → 0.3.78

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 +4 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -31,6 +31,7 @@ const argumentsParser = (
31
31
  argvLevel = 0,
32
32
  placeholder = '<>',
33
33
  command,
34
+ onCommand,
34
35
  strings = {},
35
36
  help: {
36
37
  usage: helpUsage,
@@ -151,11 +152,14 @@ const argumentsParser = (
151
152
 
152
153
  try {
153
154
 
155
+ onCommand?.(tool, args.slice(1));
156
+
154
157
  return await commands[tool]({
155
158
  args: args.slice(1),
156
159
  argumentsParser: argumentsParser({
157
160
  args: args.slice(1),
158
161
  argvLevel: argvLevel + 1,
162
+ onCommand,
159
163
  placeholder,
160
164
  command: commands[tool],
161
165
  strings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/arguments-parser",
3
- "version": "0.3.77",
3
+ "version": "0.3.78",
4
4
  "description": "Yet another arguments parser.",
5
5
  "main": "index.js",
6
6
  "type": "module",