From b6ad8e4cc1b29fe3ac318f2830bee7e3d9ea6970 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 25 Mar 2021 07:46:28 -0700 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- lib/internal/main/print_help.js | 4 ++-- src/node_options.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js index 87db8a7cff7592..029701307980b1 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 a0bbb1681cc1b8..d5c2600688767b 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,