Skip to content

Conversation

@benjie
Copy link

@benjie benjie commented Nov 7, 2025

@shadowspawn
Copy link
Member

shadowspawn commented Nov 8, 2025

Creating a new yargs parser object to get the terminal width does not seem the right pattern to me.

(I am guessing you decided against using yargsInstance as the variable name. It isn't used elsewhere in this file so not an established pattern.)

y is used in this file in a few places where a variable is used for the top level parser:

const y = yargs(process.argv.slice(2));
y.version('1.0.0');

Following that compact pattern, how about:

Use y.wrap(y.terminalWidth()) to maximize the width of yargs' usage instructions.

Copy link
Member

@shadowspawn shadowspawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yargs 18: yargs.terminalWidth() is not a function.

2 participants