diff --git a/src/node.cc b/src/node.cc index 1c776c79fc6887..c2befefefd8130 100644 --- a/src/node.cc +++ b/src/node.cc @@ -946,9 +946,8 @@ void Init(int* argc, } if (per_process::cli_options->print_v8_help) { - // Doesn't return. V8::SetFlagsFromString("--help", static_cast(6)); - UNREACHABLE(); + exit(0); } *argc = argv_.size(); @@ -1010,13 +1009,16 @@ InitializationResult InitializeOncePerProcess(int argc, char** argv) { if (per_process::cli_options->print_bash_completion) { std::string completion = options_parser::GetBashCompletion(); printf("%s\n", completion.c_str()); - exit(0); + result.exit_code = 0; + result.early_return = true; + return result; } if (per_process::cli_options->print_v8_help) { - // Doesn't return. V8::SetFlagsFromString("--help", static_cast(6)); - UNREACHABLE(); + result.exit_code = 0; + result.early_return = true; + return result; } #if HAVE_OPENSSL