Skip to content

Commit a6ed940

Browse files
committed
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. Before: ``` --frozen-intrinsics experimental frozen intrinsics support --heap-prof Start the V8 heap profiler on start up, and write the heap profile to disk before exit. If --heap-prof-dir is not specified, write the profile to the current working directory. --heap-prof-dir=... Directory where the V8 heap profiles generated by --heap-prof will be placed. ``` After: ``` --frozen-intrinsics experimental frozen intrinsics support --heap-prof Start the V8 heap profiler on start up, and write the heap profile to disk before exit. If --heap-prof-dir is not specified, write the profile to the current working directory. --heap-prof-dir=... Directory where the V8 heap profiles generated by --heap-prof will be placed. ``` Doing this made an uncharacteristic trailing newline in the `--icu-data-dir` help text more obvious, so I removed that.
1 parent f00c243 commit a6ed940

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/internal/main/print_help.js

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ PerProcessOptionsParser::PerProcessOptionsParser(
725725
AddOption("--icu-data-dir",
726726
"set ICU data load path to dir (overrides NODE_ICU_DATA)"
727727
#ifndef NODE_HAVE_SMALL_ICU
728-
" (note: linked-in ICU data is present)\n"
728+
" (note: linked-in ICU data is present)"
729729
#endif
730730
,
731731
&PerProcessOptions::icu_data_dir,

0 commit comments

Comments
 (0)