From c658026da68ccd5f0053a2772ebe2735cf017855 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 8 Sep 2020 20:36:33 +0200 Subject: [PATCH] doc,test: specify and test CLI option precedence rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/35098#issuecomment-689051526 PR-URL: https://github.com/nodejs/node/pull/35106 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Gerhard Stöbich Reviewed-By: Myles Borins Reviewed-By: Zeyu Yang Reviewed-By: Gireesh Punathil --- doc/api/cli.md | 6 ++++++ test/parallel/test-cli-options-precedence.js | 22 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/parallel/test-cli-options-precedence.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 260f48093129e2..5900ffd5ccbe4f 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -34,6 +34,11 @@ dashes (`-`) or underscores (`_`). For example, `--pending-deprecation` is equivalent to `--pending_deprecation`. +If an option that takes a single value, for example `--max-http-header-size`, +is passed more than once, then the last passed value will be used. Options +from the command line take precedence over options passed through the +[`NODE_OPTIONS`][] environment variable. + ### `-`