From 1f0fd1bb789362a68e58cc5d2e9c0abb2658d2c5 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Thu, 4 Jul 2019 15:28:22 -0700 Subject: [PATCH] src: add missing option parser template for the DebugOptionsParser This allows embedders to run `node::options_parser::Parse` for a `node::DebugOptions`. PR-URL: https://github.com/nodejs/node/pull/28543 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Eugene Ostroukhov Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig --- src/node_options.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/node_options.cc b/src/node_options.cc index 53a4171edaa399..b6ea82158c07ae 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -226,6 +226,17 @@ class PerProcessOptionsParser : public OptionsParser { #if HAVE_INSPECTOR const DebugOptionsParser _dop_instance{}; const EnvironmentOptionsParser _eop_instance{_dop_instance}; + +// This Parse is not dead code. It is used by embedders (e.g., Electron). +template <> +void Parse( + StringVector* const args, StringVector* const exec_args, + StringVector* const v8_args, + DebugOptions* const options, + OptionEnvvarSettings required_env_settings, StringVector* const errors) { + _dop_instance.Parse( + args, exec_args, v8_args, options, required_env_settings, errors); +} #else const EnvironmentOptionsParser _eop_instance{}; #endif // HAVE_INSPECTOR