From 3ef1512f9e416cc7656b9cd16934dffdee1b11d3 Mon Sep 17 00:00:00 2001 From: Maƫl Nison Date: Sat, 3 Nov 2018 10:52:44 -0700 Subject: src: allows escaping NODE_OPTIONS with backslashes The characters specified within NODE_OPTIONS can now be escaped, which is handy especially in conjunction with `--require` (where the file path might happen to contain spaces that shouldn't cause the option to be split into two). Fixes: https://github.com/nodejs/node/issues/12971 PR-URL: https://github.com/nodejs/node/pull/24065 Reviewed-By: Anna Henningsen --- doc/api/cli.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/api/cli.md b/doc/api/cli.md index 79f2dcd2ba..a2c92b1334 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -774,6 +774,13 @@ if they had been specified on the command line before the actual command line (so they can be overridden). Node.js will exit with an error if an option that is not allowed in the environment is used, such as `-p` or a script file. +In case an option value happens to contain a space (for example a path listed in +`--require`), it must be escaped using double quotes. For example: + +```bash +--require "./my path/file.js" +``` + Node.js options that are allowed are: - `--diagnostic-report-directory` - `--diagnostic-report-filename` -- cgit v1.2.3