Skip to content

Commit b6ad8e4

Browse files
glasserruyadorno
authored andcommittedMar 30, 2021
src: indent long help text properly
The previous code passed an ignored argument to StringPrototypeTrimLeft, and tried to trim a string that didn't start with whitespace. The trim makes more sense after the indentation has been added. Now wrapped lines actually show up with the rest of the help text. Doing this made an uncharacteristic trailing newline in the `--icu-data-dir` help text more obvious, so I removed that. PR-URL: #37911 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 13ecff6 commit b6ad8e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎lib/internal/main/print_help.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ function format(
152152
else
153153
text += StringPrototypeRepeat(' ', firstColumn - displayName.length);
154154

155-
text += indent(StringPrototypeTrimLeft(fold(displayHelpText, secondColumn),
156-
firstColumn)) + '\n';
155+
text += StringPrototypeTrimLeft(
156+
indent(fold(displayHelpText, secondColumn), firstColumn)) + '\n';
157157
}
158158

159159
if (maxFirstColumnUsed < firstColumn - 4) {

‎src/node_options.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ PerProcessOptionsParser::PerProcessOptionsParser(
729729
AddOption("--icu-data-dir",
730730
"set ICU data load path to dir (overrides NODE_ICU_DATA)"
731731
#ifndef NODE_HAVE_SMALL_ICU
732-
" (note: linked-in ICU data is present)\n"
732+
" (note: linked-in ICU data is present)"
733733
#endif
734734
,
735735
&PerProcessOptions::icu_data_dir,

0 commit comments

Comments
 (0)
Please sign in to comment.