@pristine-ts/cli 2.0.16 → 2.0.18

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 (142) hide show
  1. package/dist/lib/cjs/bin.js +0 -0
  2. package/dist/lib/cjs/cli.configuration-keys.js +6 -0
  3. package/dist/lib/cjs/cli.configuration-keys.js.map +1 -1
  4. package/dist/lib/cjs/cli.module.js +13 -0
  5. package/dist/lib/cjs/cli.module.js.map +1 -1
  6. package/dist/lib/cjs/errors/cli-error-code.enum.js +10 -0
  7. package/dist/lib/cjs/errors/cli-error-code.enum.js.map +1 -1
  8. package/dist/lib/cjs/interfaces/command-parameter-choice.interface.js +3 -0
  9. package/dist/lib/cjs/interfaces/command-parameter-choice.interface.js.map +1 -0
  10. package/dist/lib/cjs/interfaces/command-parameter-choices-context.interface.js +3 -0
  11. package/dist/lib/cjs/interfaces/command-parameter-choices-context.interface.js.map +1 -0
  12. package/dist/lib/cjs/interfaces/command-parameter-choices-provider.interface.js +3 -0
  13. package/dist/lib/cjs/interfaces/command-parameter-choices-provider.interface.js.map +1 -0
  14. package/dist/lib/cjs/interfaces/interfaces.js +3 -0
  15. package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
  16. package/dist/lib/cjs/reporters/cli-error.reporter.js +11 -3
  17. package/dist/lib/cjs/reporters/cli-error.reporter.js.map +1 -1
  18. package/dist/lib/cjs/services/command-argument-error-formatter.js +146 -0
  19. package/dist/lib/cjs/services/command-argument-error-formatter.js.map +1 -0
  20. package/dist/lib/cjs/services/command-argument-resolver.js +1 -1
  21. package/dist/lib/cjs/services/command-argument-resolver.js.map +1 -1
  22. package/dist/lib/cjs/services/command-options-resolver.js +30 -37
  23. package/dist/lib/cjs/services/command-options-resolver.js.map +1 -1
  24. package/dist/lib/cjs/services/command-parameter-prompter.js +118 -38
  25. package/dist/lib/cjs/services/command-parameter-prompter.js.map +1 -1
  26. package/dist/lib/cjs/services/command-usage-renderer.js +81 -0
  27. package/dist/lib/cjs/services/command-usage-renderer.js.map +1 -0
  28. package/dist/lib/cjs/services/program-name-resolver.js +98 -0
  29. package/dist/lib/cjs/services/program-name-resolver.js.map +1 -0
  30. package/dist/lib/cjs/services/services.js +3 -0
  31. package/dist/lib/cjs/services/services.js.map +1 -1
  32. package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  33. package/dist/lib/cjs/types/command-parameter-choices-list.type.js +3 -0
  34. package/dist/lib/cjs/types/command-parameter-choices-list.type.js.map +1 -0
  35. package/dist/lib/cjs/types/command-parameter-choices-resolver.type.js +3 -0
  36. package/dist/lib/cjs/types/command-parameter-choices-resolver.type.js.map +1 -0
  37. package/dist/lib/cjs/types/command-parameter-choices.type.js +3 -0
  38. package/dist/lib/cjs/types/command-parameter-choices.type.js.map +1 -0
  39. package/dist/lib/cjs/types/types.js +3 -0
  40. package/dist/lib/cjs/types/types.js.map +1 -1
  41. package/dist/lib/esm/cli.configuration-keys.js +6 -0
  42. package/dist/lib/esm/cli.configuration-keys.js.map +1 -1
  43. package/dist/lib/esm/cli.module.js +13 -0
  44. package/dist/lib/esm/cli.module.js.map +1 -1
  45. package/dist/lib/esm/errors/cli-error-code.enum.js +10 -0
  46. package/dist/lib/esm/errors/cli-error-code.enum.js.map +1 -1
  47. package/dist/lib/esm/interfaces/command-parameter-choice.interface.js +2 -0
  48. package/dist/lib/esm/interfaces/command-parameter-choice.interface.js.map +1 -0
  49. package/dist/lib/esm/interfaces/command-parameter-choices-context.interface.js +2 -0
  50. package/dist/lib/esm/interfaces/command-parameter-choices-context.interface.js.map +1 -0
  51. package/dist/lib/esm/interfaces/command-parameter-choices-provider.interface.js +2 -0
  52. package/dist/lib/esm/interfaces/command-parameter-choices-provider.interface.js.map +1 -0
  53. package/dist/lib/esm/interfaces/interfaces.js +3 -0
  54. package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
  55. package/dist/lib/esm/reporters/cli-error.reporter.js +11 -3
  56. package/dist/lib/esm/reporters/cli-error.reporter.js.map +1 -1
  57. package/dist/lib/esm/services/command-argument-error-formatter.js +143 -0
  58. package/dist/lib/esm/services/command-argument-error-formatter.js.map +1 -0
  59. package/dist/lib/esm/services/command-argument-resolver.js +1 -1
  60. package/dist/lib/esm/services/command-argument-resolver.js.map +1 -1
  61. package/dist/lib/esm/services/command-options-resolver.js +31 -38
  62. package/dist/lib/esm/services/command-options-resolver.js.map +1 -1
  63. package/dist/lib/esm/services/command-parameter-prompter.js +120 -40
  64. package/dist/lib/esm/services/command-parameter-prompter.js.map +1 -1
  65. package/dist/lib/esm/services/command-usage-renderer.js +78 -0
  66. package/dist/lib/esm/services/command-usage-renderer.js.map +1 -0
  67. package/dist/lib/esm/services/program-name-resolver.js +62 -0
  68. package/dist/lib/esm/services/program-name-resolver.js.map +1 -0
  69. package/dist/lib/esm/services/services.js +3 -0
  70. package/dist/lib/esm/services/services.js.map +1 -1
  71. package/dist/lib/esm/tsconfig.tsbuildinfo +1 -1
  72. package/dist/lib/esm/types/command-parameter-choices-list.type.js +2 -0
  73. package/dist/lib/esm/types/command-parameter-choices-list.type.js.map +1 -0
  74. package/dist/lib/esm/types/command-parameter-choices-resolver.type.js +2 -0
  75. package/dist/lib/esm/types/command-parameter-choices-resolver.type.js.map +1 -0
  76. package/dist/lib/esm/types/command-parameter-choices.type.js +2 -0
  77. package/dist/lib/esm/types/command-parameter-choices.type.js.map +1 -0
  78. package/dist/lib/esm/types/types.js +3 -0
  79. package/dist/lib/esm/types/types.js.map +1 -1
  80. package/dist/types/cli.configuration-keys.d.ts +7 -0
  81. package/dist/types/errors/cli-error-code.enum.d.ts +10 -0
  82. package/dist/types/interfaces/command-parameter-choice.interface.d.ts +14 -0
  83. package/dist/types/interfaces/command-parameter-choices-context.interface.d.ts +17 -0
  84. package/dist/types/interfaces/command-parameter-choices-provider.interface.d.ts +20 -0
  85. package/dist/types/interfaces/interfaces.d.ts +3 -0
  86. package/dist/types/options/command-parameter.options.d.ts +30 -0
  87. package/dist/types/services/command-argument-error-formatter.d.ts +64 -0
  88. package/dist/types/services/command-options-resolver.d.ts +23 -13
  89. package/dist/types/services/command-parameter-prompter.d.ts +60 -31
  90. package/dist/types/services/command-usage-renderer.d.ts +35 -0
  91. package/dist/types/services/program-name-resolver.d.ts +21 -0
  92. package/dist/types/services/services.d.ts +3 -0
  93. package/dist/types/types/command-parameter-choices-list.type.d.ts +6 -0
  94. package/dist/types/types/command-parameter-choices-resolver.type.d.ts +9 -0
  95. package/dist/types/types/command-parameter-choices.type.d.ts +19 -0
  96. package/dist/types/types/types.d.ts +3 -0
  97. package/package.json +12 -12
  98. package/dist/lib/cjs/bootstrap/app-module-cache.js +0 -71
  99. package/dist/lib/cjs/bootstrap/app-module-cache.js.map +0 -1
  100. package/dist/lib/cjs/bootstrap/app-module-discoverer.js +0 -119
  101. package/dist/lib/cjs/bootstrap/app-module-discoverer.js.map +0 -1
  102. package/dist/lib/cjs/bootstrap/app-module-discovery-candidate.js +0 -21
  103. package/dist/lib/cjs/bootstrap/app-module-discovery-candidate.js.map +0 -1
  104. package/dist/lib/cjs/bootstrap/app-module-discovery-reason.enum.js +0 -15
  105. package/dist/lib/cjs/bootstrap/app-module-discovery-reason.enum.js.map +0 -1
  106. package/dist/lib/cjs/bootstrap/app-module-prompt.js +0 -78
  107. package/dist/lib/cjs/bootstrap/app-module-prompt.js.map +0 -1
  108. package/dist/lib/cjs/commands/config-init.command.js +0 -133
  109. package/dist/lib/cjs/commands/config-init.command.js.map +0 -1
  110. package/dist/lib/cjs/enums/exit-code.enum.js +0 -9
  111. package/dist/lib/cjs/enums/exit-code.enum.js.map +0 -1
  112. package/dist/lib/cjs/managers/console.manager.js +0 -277
  113. package/dist/lib/cjs/managers/console.manager.js.map +0 -1
  114. package/dist/lib/cjs/managers/repl-session.js +0 -251
  115. package/dist/lib/cjs/managers/repl-session.js.map +0 -1
  116. package/dist/lib/esm/bootstrap/app-module-cache.js +0 -65
  117. package/dist/lib/esm/bootstrap/app-module-cache.js.map +0 -1
  118. package/dist/lib/esm/bootstrap/app-module-discoverer.js +0 -113
  119. package/dist/lib/esm/bootstrap/app-module-discoverer.js.map +0 -1
  120. package/dist/lib/esm/bootstrap/app-module-discovery-candidate.js +0 -17
  121. package/dist/lib/esm/bootstrap/app-module-discovery-candidate.js.map +0 -1
  122. package/dist/lib/esm/bootstrap/app-module-discovery-reason.enum.js +0 -12
  123. package/dist/lib/esm/bootstrap/app-module-discovery-reason.enum.js.map +0 -1
  124. package/dist/lib/esm/bootstrap/app-module-prompt.js +0 -75
  125. package/dist/lib/esm/bootstrap/app-module-prompt.js.map +0 -1
  126. package/dist/lib/esm/commands/config-init.command.js +0 -127
  127. package/dist/lib/esm/commands/config-init.command.js.map +0 -1
  128. package/dist/lib/esm/enums/exit-code.enum.js +0 -6
  129. package/dist/lib/esm/enums/exit-code.enum.js.map +0 -1
  130. package/dist/lib/esm/managers/console.manager.js +0 -241
  131. package/dist/lib/esm/managers/console.manager.js.map +0 -1
  132. package/dist/lib/esm/managers/repl-session.js +0 -215
  133. package/dist/lib/esm/managers/repl-session.js.map +0 -1
  134. package/dist/types/bootstrap/app-module-cache.d.ts +0 -15
  135. package/dist/types/bootstrap/app-module-discoverer.d.ts +0 -30
  136. package/dist/types/bootstrap/app-module-discovery-candidate.d.ts +0 -18
  137. package/dist/types/bootstrap/app-module-discovery-reason.enum.d.ts +0 -10
  138. package/dist/types/bootstrap/app-module-prompt.d.ts +0 -20
  139. package/dist/types/commands/config-init.command.d.ts +0 -18
  140. package/dist/types/enums/exit-code.enum.d.ts +0 -4
  141. package/dist/types/managers/console.manager.d.ts +0 -93
  142. package/dist/types/managers/repl-session.d.ts +0 -62
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=command-parameter-choices-list.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choices-list.type.js","sourceRoot":"","sources":["../../../../src/types/command-parameter-choices-list.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=command-parameter-choices-resolver.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choices-resolver.type.js","sourceRoot":"","sources":["../../../../src/types/command-parameter-choices-resolver.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=command-parameter-choices.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choices.type.js","sourceRoot":"","sources":["../../../../src/types/command-parameter-choices.type.ts"],"names":[],"mappings":""}
@@ -16,5 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./command-event.type"), exports);
18
18
  __exportStar(require("./command-event-response.type"), exports);
19
+ __exportStar(require("./command-parameter-choices-list.type"), exports);
20
+ __exportStar(require("./command-parameter-choices-resolver.type"), exports);
21
+ __exportStar(require("./command-parameter-choices.type"), exports);
19
22
  __exportStar(require("./start-repl-event-response.type"), exports);
20
23
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,gEAA8C;AAC9C,mEAAiD"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,gEAA8C;AAC9C,wEAAsD;AACtD,4EAA0D;AAC1D,mEAAiD;AACjD,mEAAiD"}
@@ -17,5 +17,11 @@ export const CliConfigurationKeys = {
17
17
  * input is not an interactive terminal, regardless of this value.
18
18
  */
19
19
  InteractiveParameters: "pristine.cli.interactiveParameters",
20
+ /**
21
+ * Explicit program name shown in generated `Usage:` lines (e.g. `myapp`). Optional: when unset,
22
+ * the CLI derives the name from `argv[1]`, falling back to `pristine`. Set it for launch shapes
23
+ * where `argv[1]` isn't the friendly name (e.g. `node dist/bin/cli.cjs`).
24
+ */
25
+ BinName: "pristine.cli.binName",
20
26
  };
21
27
  //# sourceMappingURL=cli.configuration-keys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.configuration-keys.js","sourceRoot":"","sources":["../../../src/cli.configuration-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;OAKG;IACH,qBAAqB,EAAE,oCAAoC;CACnD,CAAC"}
1
+ {"version":3,"file":"cli.configuration-keys.js","sourceRoot":"","sources":["../../../src/cli.configuration-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;OAKG;IACH,qBAAqB,EAAE,oCAAoC;IAE3D;;;;OAIG;IACH,OAAO,EAAE,sBAAsB;CACvB,CAAC"}
@@ -44,6 +44,19 @@ export const CliModule = {
44
44
  new BooleanResolver(new EnvironmentVariableResolver("PRISTINE_CLI_INTERACTIVE_PARAMETERS")),
45
45
  ],
46
46
  },
47
+ /**
48
+ * Program name shown in generated `Usage:` lines. Defaults to empty so `ProgramNameResolver`
49
+ * falls back to `basename(argv[1])` (then `pristine`); set it (here, in `pristine.config.ts`,
50
+ * or via the env var) to force a name.
51
+ */
52
+ {
53
+ parameterName: CliConfigurationKeys.BinName,
54
+ isRequired: false,
55
+ defaultValue: "",
56
+ defaultResolvers: [
57
+ new EnvironmentVariableResolver("PRISTINE_CLI_BIN_NAME"),
58
+ ],
59
+ },
47
60
  ],
48
61
  importModules: [
49
62
  CoreModule,
@@ -1 +1 @@
1
- {"version":3,"file":"cli.module.js","sourceRoot":"","sources":["../../../src/cli.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAA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pC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAE9B,yFAAyF;AACzF,yFAAyF;AACzF,mFAAmF;AACnF,oFAAoF;AACpF,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,OAAO,EAAE,gBAAgB;IACzB,wBAAwB,EAAE;QACxB;;;;;WAKG;QACH;YACE,aAAa,EAAE,oBAAoB,CAAC,qBAAqB;YACzD,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,gBAAgB,EAAE;gBAChB,IAAI,eAAe,CAAC,IAAI,2BAA2B,CAAC,qCAAqC,CAAC,CAAC;aAC5F;SACF;QACD;;;;WAIG;QACH;YACE,aAAa,EAAE,oBAAoB,CAAC,OAAO;YAC3C,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,EAAE;YAChB,gBAAgB,EAAE;gBAChB,IAAI,2BAA2B,CAAC,uBAAuB,CAAC;aACzD;SACF;KACF;IACD,aAAa,EAAE;QACb,UAAU;QACV,iBAAiB;QACjB,aAAa;QACb,qFAAqF;QACrF,iFAAiF;QACjF,mFAAmF;QACnF,qFAAqF;QACrF,0FAA0F;QAC1F,mBAAmB;QACnB,gBAAgB;KACjB;IACD;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,EAAE;QACd,CAAC,oBAAoB,GAAG,0BAA0B,CAAC,EAAE,cAAc,CAAC,MAAM;QAC1E,CAAC,oBAAoB,GAAG,gCAAgC,CAAC,EAAE,YAAY,CAAC,IAAI;KAC7E;CACF,CAAA"}
@@ -10,6 +10,16 @@ export var CliErrorCode;
10
10
  CliErrorCode["CommandNotFound"] = "COMMAND_NOT_FOUND";
11
11
  CliErrorCode["ArgumentMappingFailed"] = "ARGUMENT_MAPPING_FAILED";
12
12
  CliErrorCode["ArgumentValidationFailed"] = "ARGUMENT_VALIDATION_FAILED";
13
+ /**
14
+ * A required command-line argument was missing. Reported with the command's `Usage:` synopsis
15
+ * (exit 64). Distinct from a value supplied but invalid (`InvalidArgument`).
16
+ */
17
+ CliErrorCode["MissingRequiredArgument"] = "MISSING_REQUIRED_ARGUMENT";
18
+ /**
19
+ * A supplied command-line argument failed validation. Reported as a clean
20
+ * `Invalid <flag> '<value>'. …` line (exit 64).
21
+ */
22
+ CliErrorCode["InvalidArgument"] = "INVALID_ARGUMENT";
13
23
  /**
14
24
  * Two `@commandParameter` properties on the same options class resolve to the same flag.
15
25
  * A programming error in the command's options definition, not bad user input.
@@ -1 +1 @@
1
- {"version":3,"file":"cli-error-code.enum.js","sourceRoot":"","sources":["../../../../src/errors/cli-error-code.enum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,YAgBX;AAhBD,WAAY,YAAY;IACtB,qDAA8C,CAAA;IAC9C,iEAAoD,CAAA;IACpD,uEAAuD,CAAA;IAEvD;;;OAGG;IACH,gFAAgE,CAAA;IAEhE;;;OAGG;IACH,oDAAoC,CAAA;AACtC,CAAC,EAhBW,YAAY,KAAZ,YAAY,QAgBvB"}
1
+ {"version":3,"file":"cli-error-code.enum.js","sourceRoot":"","sources":["../../../../src/errors/cli-error-code.enum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,YA4BX;AA5BD,WAAY,YAAY;IACtB,qDAA8C,CAAA;IAC9C,iEAAoD,CAAA;IACpD,uEAAuD,CAAA;IAEvD;;;OAGG;IACH,qEAAqD,CAAA;IAErD;;;OAGG;IACH,oDAAoC,CAAA;IAEpC;;;OAGG;IACH,gFAAgE,CAAA;IAEhE;;;OAGG;IACH,oDAAoC,CAAA;AACtC,CAAC,EA5BW,YAAY,KAAZ,YAAY,QA4BvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command-parameter-choice.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choice.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/command-parameter-choice.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command-parameter-choices-context.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choices-context.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/command-parameter-choices-context.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command-parameter-choices-provider.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-parameter-choices-provider.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/command-parameter-choices-provider.interface.ts"],"names":[],"mappings":""}
@@ -1,3 +1,6 @@
1
1
  export * from "./command.interface";
2
+ export * from "./command-parameter-choice.interface";
3
+ export * from "./command-parameter-choices-context.interface";
4
+ export * from "./command-parameter-choices-provider.interface";
2
5
  export * from "./terminal-key.interface";
3
6
  //# sourceMappingURL=interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC"}
@@ -47,14 +47,22 @@ let CliErrorReporter = class CliErrorReporter {
47
47
  * `process.exit`. The bin script wraps `bootstrap().catch(err => process.exit(reporter.report(err)))`.
48
48
  */
49
49
  report(error) {
50
- var _a, _b;
50
+ var _a, _b, _c;
51
51
  const e = PristineError.from(error);
52
52
  const isDev = this.environmentManager.getEnvironment() === PristineEnvironment.Development;
53
53
  const isUserError = e.options.kind !== PristineErrorKind.SystemError;
54
+ // Plain mode: the message is already a fully formatted, user-facing block (a command's
55
+ // `Usage:` synopsis, an `Invalid <flag> …` line). Print it verbatim — no `✗ CODE:` envelope,
56
+ // no `details` rendering — and return its exit code. Honored for user errors only; a
57
+ // SystemError is never surfaced verbatim in production.
58
+ if (e.options.plain === true && isUserError) {
59
+ this.write(`${e.message}\n`);
60
+ return (_a = e.options.exitCode) !== null && _a !== void 0 ? _a : ExitCode.Error;
61
+ }
54
62
  // Headline: in production, system errors get a generic message so we don't dump
55
63
  // internal-bug messages to the user. User errors always show their own message.
56
64
  const headline = isUserError || isDev ? e.message : "Internal Error";
57
- const code = (_a = e.options.code) !== null && _a !== void 0 ? _a : "ERROR";
65
+ const code = (_b = e.options.code) !== null && _b !== void 0 ? _b : "ERROR";
58
66
  this.write(`✗ ${code}: ${headline}\n`);
59
67
  // Details: per-error-class structured fields. Surfaced for user errors always, for
60
68
  // system errors only in dev (helps debugging without leaking in prod CI logs).
@@ -81,7 +89,7 @@ let CliErrorReporter = class CliErrorReporter {
81
89
  }
82
90
  // Exit code fallback: ExitCode.Error (1) for user errors, ExitCode.Software (70)
83
91
  // for system errors. Both follow sysexits.h conventions.
84
- return (_b = e.options.exitCode) !== null && _b !== void 0 ? _b : (isUserError ? ExitCode.Error : ExitCode.Software);
92
+ return (_c = e.options.exitCode) !== null && _c !== void 0 ? _c : (isUserError ? ExitCode.Error : ExitCode.Software);
85
93
  }
86
94
  /**
87
95
  * Wraps `process.stderr.write` so a broken stderr (closed pipe, etc.) doesn't itself
@@ -1 +1 @@
1
- {"version":3,"file":"cli-error.reporter.js","sourceRoot":"","sources":["../../../../src/reporters/cli-error.reporter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;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,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;gBACpD,OAAO,GAAI,OAAiB,CAAC,KAAK,CAAC;gBACnC,KAAK,EAAE,CAAC;YACV,CAAC;QACH,CAAC;QAED,iFAAiF;QACjF,yDAAyD;QACzD,OAAO,MAAA,CAAC,CAAC,OAAO,CAAC,QAAQ,mCAAI,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,IAAY;QACxB,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAAC,WAAM,CAAC;YACP,gDAAgD;QAClD,CAAC;IACH,CAAC;IAEO,aAAa,CAAC,KAAc;QAClC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QAAC,WAAM,CAAC;YACP,IAAI,CAAC;gBACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YAAC,WAAM,CAAC;gBACP,OAAO,mBAAmB,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AApFY,gBAAgB;IAD5B,UAAU,EAAE;qCAG4B,kBAAkB;GAF9C,gBAAgB,CAoF5B"}
@@ -0,0 +1,143 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var CommandArgumentErrorFormatter_1;
11
+ import { injectable } from "tsyringe";
12
+ import { moduleScoped, UsageError } from "@pristine-ts/common";
13
+ import { PropertyMetadata } from "@pristine-ts/metadata";
14
+ import { CliModuleKeyname } from "../cli.module.keyname";
15
+ import { CliDecoratorMetadataKeynameEnum } from "../enums/cli-decorator-metadata-keyname.enum";
16
+ import { CliErrorCode } from "../errors/cli-error-code.enum";
17
+ import { CommandUsageRenderer } from "./command-usage-renderer";
18
+ /**
19
+ * Turns `@pristine-ts/class-validator`'s raw per-property validation output into a single,
20
+ * clean, user-facing `UsageError` (exit 64, rendered verbatim via `options.plain`) instead of
21
+ * a `[CONSTRAINT_KEY]`-prefixed dump:
22
+ *
23
+ * - if any *required* parameter is missing → the command's `Usage:` synopsis, so the user
24
+ * sees what to pass (and not a wall of "is not a string" noise for an absent value);
25
+ * - otherwise (values present but invalid) → one line per offending value: the parameter's
26
+ * `errorMessage` (verbatim, `%value%`/`%flag%` filled), or a generated
27
+ * `Invalid <flag> '<value>'. <validator message>` with the constraint-key prefix and
28
+ * definedness noise stripped.
29
+ *
30
+ * Returns the error rather than throwing it, so the resolver keeps the `throw` (clean control
31
+ * flow) and tests can assert on the built error directly.
32
+ */
33
+ let CommandArgumentErrorFormatter = CommandArgumentErrorFormatter_1 = class CommandArgumentErrorFormatter {
34
+ constructor(usageRenderer) {
35
+ this.usageRenderer = usageRenderer;
36
+ }
37
+ /**
38
+ * Builds the `UsageError` for a set of validation errors. `mapped` is the (failed) options
39
+ * instance — read to get each property's effective value and to tell "missing" (undefined /
40
+ * empty) from "present but invalid".
41
+ */
42
+ buildValidationError(optionsType, mapped, validationErrors, context) {
43
+ const missing = validationErrors.filter((error) => this.isMissing(mapped[error.property]));
44
+ if (missing.length > 0) {
45
+ return new UsageError(this.usageRenderer.render(optionsType, context.commandName, context.binName), {
46
+ code: CliErrorCode.MissingRequiredArgument,
47
+ plain: true,
48
+ details: { missing: missing.map((error) => this.flagFor(optionsType, error.property)).join(", ") },
49
+ });
50
+ }
51
+ const lines = validationErrors.map((error) => this.invalidLine(optionsType, mapped, error));
52
+ return new UsageError(lines.join("\n"), {
53
+ code: CliErrorCode.InvalidArgument,
54
+ plain: true,
55
+ });
56
+ }
57
+ /** A value counts as "missing" when it never arrived — undefined/null or an empty string. */
58
+ isMissing(value) {
59
+ return value === undefined || value === null || value === "";
60
+ }
61
+ /**
62
+ * One line for an offending value. A parameter's `errorMessage` is the *entire* line, used
63
+ * verbatim (with `%value%`/`%flag%` filled); otherwise we generate
64
+ * `Invalid <flag> '<value>'. <validator message>`. Sensitive parameters never echo the value
65
+ * (it is `<hidden>`, even inside a custom template).
66
+ * @private
67
+ */
68
+ invalidLine(optionsType, mapped, error) {
69
+ var _a;
70
+ const options = this.optionsFor(optionsType, error.property);
71
+ const flag = (_a = options === null || options === void 0 ? void 0 : options.flag) !== null && _a !== void 0 ? _a : error.property;
72
+ const sensitive = (options === null || options === void 0 ? void 0 : options.sensitive) === true;
73
+ const value = sensitive ? "<hidden>" : String(mapped[error.property]);
74
+ if (options === null || options === void 0 ? void 0 : options.errorMessage) {
75
+ return options.errorMessage.replace(/%value%/g, value).replace(/%flag%/g, flag);
76
+ }
77
+ const reason = this.validatorMessage(error);
78
+ return sensitive ? `Invalid ${flag}. ${reason}` : `Invalid ${flag} '${value}'. ${reason}`;
79
+ }
80
+ /**
81
+ * The validator's own message for a present-but-invalid value: the first *semantic* constraint
82
+ * message (definedness noise dropped), falling back to the first message present.
83
+ * @private
84
+ */
85
+ validatorMessage(error) {
86
+ var _a, _b;
87
+ const messages = this.constraintMessages(error);
88
+ return (_b = (_a = messages.semantic) !== null && _a !== void 0 ? _a : messages.fallback) !== null && _b !== void 0 ? _b : "Invalid value.";
89
+ }
90
+ /**
91
+ * Splits an error's constraint messages into the first *semantic* one (not a definedness
92
+ * constraint) and a plain first-seen fallback. Reads `@pristine-ts/class-validator`'s
93
+ * `{keyname, message}` constraint objects defensively.
94
+ * @private
95
+ */
96
+ constraintMessages(error) {
97
+ let semantic;
98
+ let fallback;
99
+ for (const keyname in error.constraints) {
100
+ const message = this.extractMessage(error.constraints[keyname]);
101
+ if (message === undefined) {
102
+ continue;
103
+ }
104
+ if (fallback === undefined) {
105
+ fallback = message;
106
+ }
107
+ if (semantic === undefined && CommandArgumentErrorFormatter_1.DefinednessConstraints.has(keyname.toUpperCase()) === false) {
108
+ semantic = message;
109
+ }
110
+ }
111
+ return { semantic, fallback };
112
+ }
113
+ /** Pulls the human message out of a `{keyname, message}` constraint (or a bare string). */
114
+ extractMessage(constraint) {
115
+ if (typeof constraint === "string") {
116
+ return constraint;
117
+ }
118
+ if (constraint && typeof constraint === "object" && typeof constraint.message === "string") {
119
+ return constraint.message;
120
+ }
121
+ return undefined;
122
+ }
123
+ optionsFor(optionsType, propertyKey) {
124
+ return PropertyMetadata.getMetadata(optionsType.prototype, propertyKey, CliDecoratorMetadataKeynameEnum.CommandParameter);
125
+ }
126
+ flagFor(optionsType, propertyKey) {
127
+ var _a, _b;
128
+ return (_b = (_a = this.optionsFor(optionsType, propertyKey)) === null || _a === void 0 ? void 0 : _a.flag) !== null && _b !== void 0 ? _b : propertyKey;
129
+ }
130
+ };
131
+ /**
132
+ * Constraint keynames that only trip because a value is *absent*. For a present-but-invalid
133
+ * value these never fire, so we drop them and surface the semantic constraint (e.g.
134
+ * `MATCHES`) the user actually needs — never "is not a string" for a value they gave.
135
+ */
136
+ CommandArgumentErrorFormatter.DefinednessConstraints = new Set(["IS_DEFINED", "IS_NOT_EMPTY", "IS_STRING"]);
137
+ CommandArgumentErrorFormatter = CommandArgumentErrorFormatter_1 = __decorate([
138
+ injectable(),
139
+ moduleScoped(CliModuleKeyname),
140
+ __metadata("design:paramtypes", [CommandUsageRenderer])
141
+ ], CommandArgumentErrorFormatter);
142
+ export { CommandArgumentErrorFormatter };
143
+ //# sourceMappingURL=command-argument-error-formatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-argument-error-formatter.js","sourceRoot":"","sources":["../../../../src/services/command-argument-error-formatter.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,+BAA+B,EAAC,MAAM,8CAA8C,CAAC;AAE7F,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AAGI,IAAM,6BAA6B,qCAAnC,MAAM,6BAA6B;IAQxC,YACmB,aAAmC;QAAnC,kBAAa,GAAb,aAAa,CAAsB;IAEtD,CAAC;IAED;;;;OAIG;IACH,oBAAoB,CAClB,WAAkC,EAClC,MAA2B,EAC3B,gBAAuB,EACvB,OAA+C;QAE/C,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3F,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;gBAClG,IAAI,EAAE,YAAY,CAAC,uBAAuB;gBAC1C,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE,EAAC,OAAO,EAAE,OAAO,CAAC,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U,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC3F,OAAO,UAAU,CAAC,OAAO,CAAC;QAC5B,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,UAAU,CAAC,WAAkC,EAAE,WAAmB;QACxE,OAAO,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,+BAA+B,CAAC,gBAAgB,CAAC,CAAC;IAC5H,CAAC;IAEO,OAAO,CAAC,WAAkC,EAAE,WAAmB;;QACrE,OAAO,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,0CAAE,IAAI,mCAAI,WAAW,CAAC;IACxE,CAAC;;AAtHD;;;;GAIG;AACqB,oDAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,AAAvD,CAAwD;AAN3F,6BAA6B;IAFzC,UAAU,EAAE;IACZ,YAAY,CAAC,gBAAgB,CAAC;qCAUK,oBAAoB;GAT3C,6BAA6B,CAwHzC"}
@@ -46,7 +46,7 @@ let CommandArgumentResolver = class CommandArgumentResolver {
46
46
  if (command.optionsType === null) {
47
47
  return rawArgs;
48
48
  }
49
- return this.commandOptionsResolver.resolve(command.optionsType, rawArgs);
49
+ return this.commandOptionsResolver.resolve(command.optionsType, rawArgs, { commandName: command.name });
50
50
  });
51
51
  }
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command-argument-resolver.js","sourceRoot":"","sources":["../../../../src/services/command-argument-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;;;GAUG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YACmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAEjE,CAAC;IAED;;;;;OAKG;IACG,OAAO,CAAC,OAA8B,EAAE,OAAY;;YACxD,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;gBACjC,OAAO,OAAO,CAAC;YACjB,CAAC;YACD,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3E,CAAC;KAAA;CACF,CAAA;AAlBY,uBAAuB;IAFnC,UAAU,EAAE;IACZ,YAAY,CAAC,gBAAgB,CAAC;qCAGc,sBAAsB;GAFtD,uBAAuB,CAkBnC"}
1
+ {"version":3,"file":"command-argument-resolver.js","sourceRoot":"","sources":["../../../../src/services/command-argument-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;;;GAUG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YACmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAEjE,CAAC;IAED;;;;;OAKG;IACG,OAAO,CAAC,OAA8B,EAAE,OAAY;;YACxD,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;gBACjC,OAAO,OAAO,CAAC;YACjB,CAAC;YACD,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,IAAI,EAAC,CAAC,CAAC;QACxG,CAAC;KAAA;CACF,CAAA;AAlBY,uBAAuB;IAFnC,UAAU,EAAE;IACZ,YAAY,CAAC,gBAAgB,CAAC;qCAGc,sBAAsB;GAFtD,uBAAuB,CAkBnC"}
@@ -17,21 +17,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
17
17
  });
18
18
  };
19
19
  import { injectable } from "tsyringe";
20
- import { moduleScoped, UsageError, ValidationError } from "@pristine-ts/common";
20
+ import { moduleScoped, UsageError } from "@pristine-ts/common";
21
21
  import { Validator } from "@pristine-ts/class-validator";
22
22
  import { AutoDataMappingBuilderOptions, DataMapper } from "@pristine-ts/data-mapping";
23
23
  import { CliModuleKeyname } from "../cli.module.keyname";
24
24
  import { CliErrorCode } from "../errors/cli-error-code.enum";
25
25
  import { CommandParameterPrompter } from "./command-parameter-prompter";
26
+ import { CommandArgumentErrorFormatter } from "./command-argument-error-formatter";
27
+ import { ProgramNameResolver } from "./program-name-resolver";
26
28
  /**
27
29
  * Resolves a typed, validated options instance from raw arguments: it fills any missing
28
- * `@commandParameter` values by prompting, maps the result onto a real `optionsType`
29
- * instance (prototype + decorator metadata intact, so `class-validator` finds its rules),
30
- * and validates it.
30
+ * `@commandParameter` values by prompting, maps the result onto a real `optionsType` instance
31
+ * (prototype + decorator metadata intact, so `class-validator` finds its rules), and validates
32
+ * it.
31
33
  *
32
- * This is the reusable core behind command dispatch — `CommandArgumentResolver` delegates
33
- * here — exposed so commands and dynamic flows can fill an options class from prompts on
34
- * demand, including ones not tied to a registered command:
34
+ * This is the reusable core behind command dispatch — `CommandArgumentResolver` delegates here
35
+ * — exposed so commands and dynamic flows can fill an options class from prompts on demand,
36
+ * including ones not tied to a registered command:
35
37
  *
36
38
  * ```ts
37
39
  * constructor(private readonly optionsResolver: CommandOptionsResolver) {}
@@ -39,22 +41,29 @@ import { CommandParameterPrompter } from "./command-parameter-prompter";
39
41
  * const options = await this.optionsResolver.resolve(MyOptions, {region: "us"});
40
42
  * ```
41
43
  *
42
- * Throws `UsageError` for mapping failures and `ValidationError` for validation failures —
43
- * both carry structured `details` for `CliErrorReporter`.
44
+ * Argument problems throw a `UsageError` (exit 64): mapping failures directly, and validation
45
+ * failures via `CommandArgumentErrorFormatter`, which renders a clean `Usage:` synopsis (for a
46
+ * missing required value) or `Invalid <flag> '<value>'. …` lines (for a supplied-but-invalid
47
+ * value) rather than a raw constraint dump.
44
48
  */
45
49
  let CommandOptionsResolver = class CommandOptionsResolver {
46
- constructor(validator, dataMapper, commandParameterPrompter) {
50
+ constructor(validator, dataMapper, commandParameterPrompter, argumentErrorFormatter, programNameResolver) {
47
51
  this.validator = validator;
48
52
  this.dataMapper = dataMapper;
49
53
  this.commandParameterPrompter = commandParameterPrompter;
54
+ this.argumentErrorFormatter = argumentErrorFormatter;
55
+ this.programNameResolver = programNameResolver;
50
56
  }
51
57
  /**
52
- * Prompts for any missing parameters declared on `optionsType`, then maps `rawArgs` (plus
53
- * the prompted answers) onto a real instance and validates it. `rawArgs` seeds the values
54
- * already known — anything absent that carries a `question` is asked for interactively.
58
+ * Prompts for any missing parameters declared on `optionsType`, then maps `rawArgs` (plus the
59
+ * prompted answers) onto a real instance and validates it. `rawArgs` seeds the values already
60
+ * known — anything absent that carries a `question` is asked for interactively.
61
+ * `context.commandName` is woven into the `Usage:` line shown when a required value is missing
62
+ * (defaults to a neutral placeholder for direct, command-less callers).
55
63
  */
56
64
  resolve(optionsType_1) {
57
- return __awaiter(this, arguments, void 0, function* (optionsType, rawArgs = {}) {
65
+ return __awaiter(this, arguments, void 0, function* (optionsType, rawArgs = {}, context = {}) {
66
+ var _a;
58
67
  const preparedArgs = yield this.commandParameterPrompter.fillMissingParameters(optionsType, rawArgs);
59
68
  let mapped;
60
69
  try {
@@ -73,29 +82,11 @@ let CommandOptionsResolver = class CommandOptionsResolver {
73
82
  if (validationErrors.length === 0) {
74
83
  return mapped;
75
84
  }
76
- // Reshape the class-validator output into structured `details` the reporter can render
77
- // line-by-line. Keeps the throw single-pass and the reporter format-agnostic.
78
- const failures = {};
79
- for (const error of validationErrors) {
80
- const messages = [];
81
- for (const constraintKey in error.constraints) {
82
- // `@pristine-ts/class-validator` stores constraints as `{keyname, message}` objects
83
- // rather than the plain strings vanilla class-validator uses. Extract the message
84
- // when present, falling back to JSON for unknown shapes so we never print
85
- // `[object Object]`.
86
- const constraint = error.constraints[constraintKey];
87
- const message = typeof constraint === "string"
88
- ? constraint
89
- : (constraint && typeof constraint === "object" && typeof constraint.message === "string")
90
- ? constraint.message
91
- : JSON.stringify(constraint);
92
- messages.push(`[${constraintKey}] ${message}`);
93
- }
94
- failures[error.property] = messages;
95
- }
96
- throw new ValidationError("Argument validation failed", {
97
- code: CliErrorCode.ArgumentValidationFailed,
98
- details: failures,
85
+ // Hand the raw class-validator output to the formatter, which classifies missing vs invalid
86
+ // and produces a clean, plain-rendered `UsageError` (exit 64).
87
+ throw this.argumentErrorFormatter.buildValidationError(optionsType, mapped, validationErrors, {
88
+ commandName: (_a = context.commandName) !== null && _a !== void 0 ? _a : "<command>",
89
+ binName: this.programNameResolver.resolve(),
99
90
  });
100
91
  });
101
92
  }
@@ -105,7 +96,9 @@ CommandOptionsResolver = __decorate([
105
96
  moduleScoped(CliModuleKeyname),
106
97
  __metadata("design:paramtypes", [Validator,
107
98
  DataMapper,
108
- CommandParameterPrompter])
99
+ CommandParameterPrompter,
100
+ CommandArgumentErrorFormatter,
101
+ ProgramNameResolver])
109
102
  ], CommandOptionsResolver);
110
103
  export { CommandOptionsResolver };
111
104
  //# sourceMappingURL=command-options-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-options-resolver.js","sourceRoot":"","sources":["../../../../src/services/command-options-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC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ACZ,YAAY,CAAC,gBAAgB,CAAC;qCAGC,SAAS;QACR,UAAU;QACI,wBAAwB;GAJ1D,sBAAsB,CA8DlC"}
1
+ {"version":3,"file":"command-options-resolver.js","sourceRoot":"","sources":["../../../../src/services/command-options-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,6BAA6B,EAAE,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,6BAA6B,EAAC,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AAGI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YACmB,SAAoB,EACpB,UAAsB,EACtB,wBAAkD,EAClD,sBAAqD,EACrD,mBAAwC;QAJxC,cAAS,GAAT,SAAS,CAAW;QACpB,eAAU,GAAV,UAAU,CAAY;QACtB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,2BAAsB,GAAtB,sBAAsB,CAA+B;QACrD,wBAAmB,GAAnB,mBAAmB,CAAqB;IAE3D,CAAC;IAED;;;;;;OAMG;IACG,OAAO;6DAAI,WAAgC,EAAE,UAA+B,EAAE,EAAE,UAAkC,EAAE;;YACxH,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAErG,IAAI,MAAS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