From cd9a6842c22a3bf6f39b17433d0c0daef7aaeb3e Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:21:37 +0530 Subject: [PATCH] feat(CLI): add `--no-sandbox` as alias to `--disable-sandbox` (#4722) --- tools/respec2html.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/respec2html.js b/tools/respec2html.js index 226b81fac1..6aa53ddf66 100755 --- a/tools/respec2html.js +++ b/tools/respec2html.js @@ -184,7 +184,12 @@ cli "Abort if ReSpec generates warnings (or errors).", false ) - .option("--disable-sandbox", "Disable Chromium sandboxing if needed.", false) + .option( + "--sandbox", + "Disable Chromium sandboxing if needed, with --no-sandbox.", + true + ) + .option("--disable-sandbox", "Alias of --no-sandbox.", false) .option("--devtools", "Enable debugging and show Chrome's DevTools.", false) .option("--verbose", "Log processing status to stdout.", false) .option("--localhost", "Spin up a local server to perform processing.", false) @@ -201,6 +206,11 @@ cli.action(async (source, destination, opts) => { process.exit(1); } + if (opts["disable-sandbox"]) { + opts.sandbox = false; + delete opts["disable-sandbox"]; + } + try { await run(source, destination, opts, log); process.exit(0); @@ -247,7 +257,7 @@ async function run(source, destination, options, log) { onError: log.error.bind(log), onWarning: log.warn.bind(log), onProgress: log.info.bind(log), - disableSandbox: options["disable-sandbox"], + disableSandbox: !options.sandbox, devtools: options.devtools, });