Skip to content

Commit ff3d20c

Browse files
glasserruyadorno
authored andcommitted
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 <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent d1ca01b commit ff3d20c

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)