poe-code 3.0.282 → 3.0.283

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/dist/index.js CHANGED
@@ -87651,6 +87651,20 @@ function parseArrayValue(value, schema, label) {
87651
87651
  (item) => parseScalarValue(item, itemSchema, label)
87652
87652
  );
87653
87653
  }
87654
+ function isNegativeNumericArrayToken(token, schema) {
87655
+ if (!token.startsWith("-") || token.startsWith("--")) {
87656
+ return false;
87657
+ }
87658
+ const itemSchema = unwrapOptional4(schema.item);
87659
+ if (itemSchema.kind !== "number") {
87660
+ return false;
87661
+ }
87662
+ const items = splitArrayInput(token);
87663
+ return items.length > 0 && items.every((item) => isValidNumberSchemaValue(Number(item), itemSchema));
87664
+ }
87665
+ function isNextArrayOptionToken(token, schema) {
87666
+ return token.startsWith("-") && !isNegativeNumericArrayToken(token, schema);
87667
+ }
87654
87668
  function validateArrayBounds(value, schema, label) {
87655
87669
  if (schema.minItems !== void 0 && value.length < schema.minItems) {
87656
87670
  throw new UserError(
@@ -89179,7 +89193,7 @@ function consumeFieldValue(args, index, schema, label, inlineValue) {
89179
89193
  let cursor2 = index + 1;
89180
89194
  while (cursor2 < args.length) {
89181
89195
  const token = args[cursor2] ?? "";
89182
- if (token.startsWith("-")) {
89196
+ if (isNextArrayOptionToken(token, schema)) {
89183
89197
  break;
89184
89198
  }
89185
89199
  const parsed = parseArrayValue(token, schema, label);
@@ -90055,6 +90069,12 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
90055
90069
  );
90056
90070
  return;
90057
90071
  }
90072
+ logger2.error(
90073
+ appendUsagePointer(formatCommanderErrorMessage(error3), {
90074
+ rootUsageName: options.rootUsageName,
90075
+ commandPath: options.commandPath.length > 0 ? options.commandPath : findCurrentCommanderCommandPath(options.program, options.argv ?? process.argv)
90076
+ })
90077
+ );
90058
90078
  return;
90059
90079
  }
90060
90080
  if (isHttpErrorLike(error3)) {
@@ -90072,6 +90092,9 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
90072
90092
  }
90073
90093
  process.exitCode = 1;
90074
90094
  }
90095
+ function formatCommanderErrorMessage(error3) {
90096
+ return error3.message.startsWith("error:") ? error3.message : `error: ${error3.message}`;
90097
+ }
90075
90098
  function formatInvalidEnumMessage(label, value, values, opts = {}) {
90076
90099
  const suggestions = suggest(
90077
90100
  value,
@@ -136617,7 +136640,7 @@ var init_package2 = __esm({
136617
136640
  "package.json"() {
136618
136641
  package_default2 = {
136619
136642
  name: "poe-code",
136620
- version: "3.0.282",
136643
+ version: "3.0.283",
136621
136644
  description: "CLI tool to configure Poe API for developer workflows.",
136622
136645
  type: "module",
136623
136646
  main: "./dist/index.js",