From c29e5ac5beaeab96b5715ea221b9d23279af2ce9 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 22 Sep 2018 14:34:00 +0200 Subject: [PATCH] =?UTF-8?q?cli:=20normalize=20`=5F`=20=E2=86=92=20`-`=20wh?= =?UTF-8?q?en=20parsing=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows for option syntax similar to V8’s one, e.g. `--no_warnings` has the same effect as `--no-warnings`. PR-URL: https://github.com/nodejs/node/pull/23020 Reviewed-By: Michaël Zasso Reviewed-By: Gus Caplan Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau Reviewed-By: Daniel Bevenius Reviewed-By: Trivikram Kamat --- doc/api/cli.md | 17 +++++--- lib/internal/bootstrap/node.js | 43 ++++++------------- src/node_options-inl.h | 19 +++----- src/node_options.cc | 12 +++--- .../test-cli-node-options-disallowed.js | 1 - test/parallel/test-cli-node-options.js | 1 + test/parallel/test-pending-deprecation.js | 8 ++++ .../test-process-env-allowed-flags.js | 2 +- 8 files changed, 45 insertions(+), 58 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 3f5441b82e7ce8..9c6195aa4e2f9e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -21,6 +21,18 @@ Execute without arguments to start the [REPL][]. _For more info about `node inspect`, please see the [debugger][] documentation._ ## Options + + +All options, including V8 options, allow words to be separated by both +dashes (`-`) or underscores (`_`). + +For example, `--pending-deprecation` is equivalent to `--pending_deprecation`. ### `-`