Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! cli: be more flexible about width when printing --help
  • Loading branch information
addaleax committed Sep 1, 2018
commit 8be612553cc1c362e8e5b56bf174d3ff39923fc2
6 changes: 3 additions & 3 deletions lib/internal/print_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ function print(stream) {
const { options, aliases } = getOptions();

// Use 75 % of the available width, and at least 70 characters.
const width = Math.max(70, (stream.columns * 0.75) | 0);
const firstColumn = (width * 0.4) | 0;
const secondColumn = (width * 0.57) | 0;
const width = Math.max(70, (stream.columns || 0) * 0.75);
const firstColumn = Math.floor(width * 0.4);
const secondColumn = Math.floor(width * 0.57);

options.set('-', { helpText: 'script read from stdin (default; ' +
'interactive mode if a tty)' });
Expand Down