@oclif/core 5.1.9 → 5.1.11
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/lib/help/command.js +3 -1
- package/package.json +1 -1
package/lib/help/command.js
CHANGED
|
@@ -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
|
-
|
|
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))}`;
|