From 0c5e0e5a85beb0b04ac8947383d7dc5ab4e0d6fb Mon Sep 17 00:00:00 2001 From: Joel Purra Date: Wed, 20 Oct 2021 12:29:51 +0200 Subject: [PATCH] feat: Wrap web-ext usage output at terminal width - Detects the terminal width (in characters) using `yargs.terminalWidth()`. - Sets the generated `yargs` usage to wrap at the terminal width instead of at the default (maximum) 80 characters. - Should improve `web-ext` readability by utilizing the full terminal window, when it is greater than 80 characters wide. - In particular, `--help` output is improved. - Testing would require a TTY emulator. Tests were added and removed in #2329 due to build system tooling issues. See - https://yargs.js.org/docs/#api-reference-wrapcolumns - https://github.com/mozilla/web-ext/pull/2329 --- src/program.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/program.js b/src/program.js index ba526a0178..46b4c37cc0 100644 --- a/src/program.js +++ b/src/program.js @@ -89,6 +89,7 @@ export class Program { 'boolean-negation': true, }); this.yargs.strict(); + this.yargs.wrap(this.yargs.terminalWidth()); this.commands = {}; this.options = {};