From 559197b1ba7aed4853f074269b35d2eed14c1c51 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 Refs: https://github.com/nodejs/node/pull/35098#issuecomment-689051526 --- 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. + ### `-`