From 006c7b78dac6e03e5eeb8216a6640d5616470039 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 caea95d79d5da6..ad269806e61c3b 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 979a5150b55327..3c9fe815dffb37 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -704,7 +704,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,