Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Glasser <glasser@davidglasser.net>2021-03-25 17:46:28 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-03-30 03:17:20 +0300
commitb6ad8e4cc1b29fe3ac318f2830bee7e3d9ea6970 (patch)
treec0e3a8c4e518bd9196da37114c366cb56c6f441d
parent13ecff63d6ff2da3b3f4e02c2c4b373cb557f994 (diff)
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: https://github.com/nodejs/node/pull/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>
-rw-r--r--lib/internal/main/print_help.js4
-rw-r--r--src/node_options.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js
index 87db8a7cff7..02970130798 100644
--- a/lib/internal/main/print_help.js
+++ b/lib/internal/main/print_help.js
@@ -152,8 +152,8 @@ function format(
else
text += StringPrototypeRepeat(' ', firstColumn - displayName.length);
- text += indent(StringPrototypeTrimLeft(fold(displayHelpText, secondColumn),
- firstColumn)) + '\n';
+ text += StringPrototypeTrimLeft(
+ indent(fold(displayHelpText, secondColumn), firstColumn)) + '\n';
}
if (maxFirstColumnUsed < firstColumn - 4) {
diff --git a/src/node_options.cc b/src/node_options.cc
index a0bbb1681cc..d5c26006887 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -729,7 +729,7 @@ PerProcessOptionsParser::PerProcessOptionsParser(
AddOption("--icu-data-dir",
"set ICU data load path to dir (overrides NODE_ICU_DATA)"
#ifndef NODE_HAVE_SMALL_ICU
- " (note: linked-in ICU data is present)\n"
+ " (note: linked-in ICU data is present)"
#endif
,
&PerProcessOptions::icu_data_dir,