@oclif/core 5.1.9 → 5.1.10

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.
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CommandHelp = void 0;
7
7
  const ansis_1 = __importDefault(require("ansis"));
8
+ const string_width_1 = __importDefault(require("string-width"));
8
9
  const ensure_arg_object_1 = require("../util/ensure-arg-object");
9
10
  const ids_1 = require("../util/ids");
10
11
  const util_1 = require("../util/util");
@@ -208,7 +209,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
208
209
  if (!flag.char)
209
210
  flagHelp = flagHelp.replace(' '.repeat(4), '');
210
211
  flagHelp +=
211
- flagHelp.length + summary.length + 2 < this.opts.maxWidth
212
+ // maxWidth is a terminal width, so compare against display width instead of code unit count
213
+ (0, string_width_1.default)(flagHelp) + (0, string_width_1.default)(summary) + 2 < this.opts.maxWidth
212
214
  ? ' ' + summary
213
215
  : '\n\n' + this.indent(this.wrap(summary, this.indentSpacing * 2));
214
216
  return `${flagHelp}\n\n${this.indent(this.wrap(flag.description || '', this.indentSpacing * 2))}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "5.1.9",
4
+ "version": "5.1.10",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {