@optique/core 1.0.0-dev.1500 → 1.0.0-dev.1502

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/message.cjs CHANGED
@@ -413,7 +413,7 @@ function formatMessage(msg, options = {}) {
413
413
  totalWidth = 0;
414
414
  continue;
415
415
  }
416
- if (options.maxWidth != null && totalWidth + width > options.maxWidth) {
416
+ if (options.maxWidth != null && totalWidth > 0 && totalWidth + width > options.maxWidth) {
417
417
  output += "\n";
418
418
  totalWidth = 0;
419
419
  }
package/dist/message.js CHANGED
@@ -412,7 +412,7 @@ function formatMessage(msg, options = {}) {
412
412
  totalWidth = 0;
413
413
  continue;
414
414
  }
415
- if (options.maxWidth != null && totalWidth + width > options.maxWidth) {
415
+ if (options.maxWidth != null && totalWidth > 0 && totalWidth + width > options.maxWidth) {
416
416
  output += "\n";
417
417
  totalWidth = 0;
418
418
  }
package/dist/usage.cjs CHANGED
@@ -180,7 +180,7 @@ function formatUsage(programName, usage, options = {}) {
180
180
  output += " ";
181
181
  lineWidth += 1;
182
182
  }
183
- } else if (options.maxWidth != null && lineWidth + width > options.maxWidth) {
183
+ } else if (options.maxWidth != null && lineWidth > 0 && lineWidth + width > options.maxWidth) {
184
184
  if (output.endsWith(" ")) output = output.slice(0, -1);
185
185
  output += "\n";
186
186
  lineWidth = 0;
@@ -418,7 +418,7 @@ function formatUsageTerm(term, options = {}) {
418
418
  let lineWidth = 0;
419
419
  let output = "";
420
420
  for (const { text, width } of formatUsageTermInternal(visibleTerms[0], options)) {
421
- if (options.maxWidth != null && lineWidth + width > options.maxWidth) {
421
+ if (options.maxWidth != null && lineWidth > 0 && lineWidth + width > options.maxWidth) {
422
422
  if (output.endsWith(" ")) output = output.slice(0, -1);
423
423
  output += "\n";
424
424
  lineWidth = 0;
package/dist/usage.js CHANGED
@@ -180,7 +180,7 @@ function formatUsage(programName, usage, options = {}) {
180
180
  output += " ";
181
181
  lineWidth += 1;
182
182
  }
183
- } else if (options.maxWidth != null && lineWidth + width > options.maxWidth) {
183
+ } else if (options.maxWidth != null && lineWidth > 0 && lineWidth + width > options.maxWidth) {
184
184
  if (output.endsWith(" ")) output = output.slice(0, -1);
185
185
  output += "\n";
186
186
  lineWidth = 0;
@@ -418,7 +418,7 @@ function formatUsageTerm(term, options = {}) {
418
418
  let lineWidth = 0;
419
419
  let output = "";
420
420
  for (const { text, width } of formatUsageTermInternal(visibleTerms[0], options)) {
421
- if (options.maxWidth != null && lineWidth + width > options.maxWidth) {
421
+ if (options.maxWidth != null && lineWidth > 0 && lineWidth + width > options.maxWidth) {
422
422
  if (output.endsWith(" ")) output = output.slice(0, -1);
423
423
  output += "\n";
424
424
  lineWidth = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1500+dc0650e5",
3
+ "version": "1.0.0-dev.1502+fda779c7",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",