Skip to content

Commit

Permalink
doc: use command-line/command line consistently
Browse files Browse the repository at this point in the history
Docs switch between "command line" and "command-line" with no apparent
uniformity. Microsoft Style Guide prescribes "command line" as a noun
and "command-line" as a modifier, which makes a lot of sense to me.
Updating docs as appropriate.

PR-URL: nodejs#35198
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Trott authored and joesepi committed Oct 22, 2020
1 parent c6d74ac commit f6ea3a8
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3242,12 +3242,12 @@ if `size` is less than or equal to half [`Buffer.poolSize`][]. Instances
returned by [`Buffer.allocUnsafeSlow()`][] *never* use the shared internal
memory pool.

### The `--zero-fill-buffers` command line option
### The `--zero-fill-buffers` command-line option
<!-- YAML
added: v5.10.0
-->

Node.js can be started using the `--zero-fill-buffers` command line option to
Node.js can be started using the `--zero-fill-buffers` command-line option to
cause all newly-allocated `Buffer` instances to be zero-filled upon creation by
default. Without the option, buffers created with [`Buffer.allocUnsafe()`][],
[`Buffer.allocUnsafeSlow()`][], and `new SlowBuffer(size)` are not zero-filled.
Expand Down
6 changes: 3 additions & 3 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ changes:
* Returns: {ChildProcess}

The `child_process.spawn()` method spawns a new process using the given
`command`, with command line arguments in `args`. If omitted, `args` defaults
`command`, with command-line arguments in `args`. If omitted, `args` defaults
to an empty array.

**If the `shell` option is enabled, do not pass unsanitized user input to this
Expand Down Expand Up @@ -1398,7 +1398,7 @@ the child process if any, else `null`.

* {Array}

The `subprocess.spawnargs` property represents the full list of command line
The `subprocess.spawnargs` property represents the full list of command-line
arguments the child process was launched with.

### `subprocess.spawnfile`
Expand Down Expand Up @@ -1547,7 +1547,7 @@ to `stdout` although there are only 4 characters.
## Shell requirements

The shell should understand the `-c` switch. If the shell is `'cmd.exe'`, it
should understand the `/d /s /c` switches and command line parsing should be
should understand the `/d /s /c` switches and command-line parsing should be
compatible.

## Default Windows shell
Expand Down
32 changes: 16 additions & 16 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Command line options
# Command-line options

<!--introduced_in=v5.9.1-->
<!--type=misc-->
Expand Down Expand Up @@ -43,7 +43,7 @@ environment variable.
added: v8.0.0
-->

Alias for stdin. Analogous to the use of `-` in other command line utilities,
Alias for stdin. Analogous to the use of `-` in other command-line utilities,
meaning that the script is read from stdin, and the rest of the options
are passed to that script.

Expand Down Expand Up @@ -128,7 +128,7 @@ Specify the directory where the CPU profiles generated by `--cpu-prof` will
be placed.

The default value is controlled by the
[--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
[--diagnostic-dir](#cli_diagnostic_dir_directory) command-line option.

### `--cpu-prof-interval`
<!-- YAML
Expand Down Expand Up @@ -209,7 +209,7 @@ changes:
-->

Experimental `AbortController` and `AbortSignal` support is enabled by default.
Use of this command line flag is no longer required.
Use of this command-line flag is no longer required.

### `--experimental-import-meta-resolve`
<!-- YAML
Expand Down Expand Up @@ -383,7 +383,7 @@ Specify the directory where the heap profiles generated by `--heap-prof` will
be placed.

The default value is controlled by the
[--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
[--diagnostic-dir](#cli_diagnostic_dir_directory) command-line option.

### `--heap-prof-interval`
<!-- YAML
Expand Down Expand Up @@ -562,7 +562,7 @@ Emit pending deprecation warnings.

Pending deprecations are generally identical to a runtime deprecation with the
notable exception that they are turned *off* by default and will not be emitted
unless either the `--pending-deprecation` command line flag, or the
unless either the `--pending-deprecation` command-line flag, or the
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
are used to provide a kind of selective "early warning" mechanism that
developers may leverage to detect deprecated API usage.
Expand Down Expand Up @@ -608,7 +608,7 @@ be thrown if `moduleA` attempts to require `moduleB` as a peer dependency:
└── package.json
```

The `--preserve-symlinks` command line flag instructs Node.js to use the
The `--preserve-symlinks` command-line flag instructs Node.js to use the
symlink path for modules as opposed to the real path, allowing symbolically
linked peer dependencies to be found.

Expand Down Expand Up @@ -667,7 +667,7 @@ warning will be written to stderr instead.

The `file` name may be an absolute path. If it is not, the default directory it
will be written to is controlled by the
[--diagnostic-dir](#cli_diagnostic_dir_directory) command line option.
[--diagnostic-dir](#cli_diagnostic_dir_directory) command-line option.

### `--report-compact`
<!-- YAML
Expand Down Expand Up @@ -1066,7 +1066,7 @@ The following values are valid for `mode`:
added: v0.1.3
-->

Print V8 command line options.
Print V8 command-line options.

### `--v8-pool-size=num`
<!-- YAML
Expand Down Expand Up @@ -1123,7 +1123,7 @@ and `"` are usable.
added: v0.1.3
-->

Print node command line options.
Print node command-line options.
The output of this option is less detailed than this document.

### `-i`, `--interactive`
Expand Down Expand Up @@ -1218,8 +1218,8 @@ When set to `1`, process warnings are silenced.
added: v8.0.0
-->

A space-separated list of command line options. `options...` are interpreted
before command line options, so command line options will override or
A space-separated list of command-line options. `options...` are interpreted
before command-line options, so command-line options will override or
compound after anything in `options...`. 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.
Expand All @@ -1230,7 +1230,7 @@ If an option value contains a space, it can be escaped using double quotes:
NODE_OPTIONS='--require "./my path/file.js"'
```

A singleton flag passed as a command line option will override the same flag
A singleton flag passed as a command-line option will override the same flag
passed into `NODE_OPTIONS`:

```bash
Expand All @@ -1239,7 +1239,7 @@ NODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555
```

A flag that can be passed multiple times will be treated as if its
`NODE_OPTIONS` instances were passed first, and then its command line
`NODE_OPTIONS` instances were passed first, and then its command-line
instances afterwards:

```bash
Expand Down Expand Up @@ -1365,7 +1365,7 @@ When set to `1`, emit pending deprecation warnings.

Pending deprecations are generally identical to a runtime deprecation with the
notable exception that they are turned *off* by default and will not be emitted
unless either the `--pending-deprecation` command line flag, or the
unless either the `--pending-deprecation` command-line flag, or the
`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
are used to provide a kind of selective "early warning" mechanism that
developers may leverage to detect deprecated API usage.
Expand Down Expand Up @@ -1513,7 +1513,7 @@ Load an OpenSSL configuration file on startup. Among other uses, this can be
used to enable FIPS-compliant crypto if Node.js is built with `./configure
--openssl-fips`.

If the [`--openssl-config`][] command line option is used, the environment
If the [`--openssl-config`][] command-line option is used, the environment
variable is ignored.

### `SSL_CERT_DIR=dir`
Expand Down
2 changes: 1 addition & 1 deletion doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ emitter.once('event', () => {
});
```

The [`--trace-warnings`][] command line flag can be used to display the
The [`--trace-warnings`][] command-line flag can be used to display the
stack trace for such warnings.

The emitted warning can be inspected with [`process.on('warning')`][] and will
Expand Down
2 changes: 1 addition & 1 deletion doc/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* [C++ embedder API](embedding.html)
* [Child processes](child_process.html)
* [Cluster](cluster.html)
* [Command line options](cli.html)
* [Command-line options](cli.html)
* [Console](console.html)
* [Crypto](crypto.html)
* [Debugger](debugger.html)
Expand Down
14 changes: 7 additions & 7 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,16 @@ $ node --no-warnings
The `--trace-warnings` command-line option can be used to have the default
console output for warnings include the full stack trace of the warning.

Launching Node.js using the `--throw-deprecation` command line flag will
Launching Node.js using the `--throw-deprecation` command-line flag will
cause custom deprecation warnings to be thrown as exceptions.

Using the `--trace-deprecation` command line flag will cause the custom
Using the `--trace-deprecation` command-line flag will cause the custom
deprecation to be printed to `stderr` along with the stack trace.

Using the `--no-deprecation` command line flag will suppress all reporting
Using the `--no-deprecation` command-line flag will suppress all reporting
of the custom deprecation.

The `*-deprecation` command line flags only affect warnings that use the name
The `*-deprecation` command-line flags only affect warnings that use the name
`'DeprecationWarning'`.

#### Emitting custom warnings
Expand Down Expand Up @@ -618,11 +618,11 @@ added: v0.1.27

* {string[]}

The `process.argv` property returns an array containing the command line
The `process.argv` property returns an array containing the command-line
arguments passed when the Node.js process was launched. The first element will
be [`process.execPath`][]. See `process.argv0` if access to the original value
of `argv[0]` is needed. The second element will be the path to the JavaScript
file being executed. The remaining elements will be any additional command line
file being executed. The remaining elements will be any additional command-line
arguments.

For example, assuming the following script for `process-args.js`:
Expand Down Expand Up @@ -2420,7 +2420,7 @@ the current value of `ps`.
When a new value is assigned, different platforms will impose different maximum
length restrictions on the title. Usually such restrictions are quite limited.
For instance, on Linux and macOS, `process.title` is limited to the size of the
binary name plus the length of the command line arguments because setting the
binary name plus the length of the command-line arguments because setting the
`process.title` overwrites the `argv` memory of the process. Node.js v0.8
allowed for longer process title strings by also overwriting the `environ`
memory but that was potentially insecure and confusing in some (rather obscure)
Expand Down
4 changes: 2 additions & 2 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Error: foo

#### `await` keyword

With the [`--experimental-repl-await`][] command line option specified,
With the [`--experimental-repl-await`][] command-line option specified,
experimental support for the `await` keyword is enabled.

```console
Expand Down Expand Up @@ -539,7 +539,7 @@ added: v11.10.0
* `repl` {repl.REPLServer}

Initializes a history log file for the REPL instance. When executing the
Node.js binary and using the command line REPL, a history file is initialized
Node.js binary and using the command-line REPL, a history file is initialized
by default. However, this is not the case when creating a REPL
programmatically. Use this method to initialize a history log file when working
with REPL instances programmatically.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/synopsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

`node [options] [V8 options] [script.js | -e "script" | - ] [arguments]`

Please see the [Command Line Options][] document for more information.
Please see the [Command-line options][] document for more information.

## Example
An example of a [web server][] written with Node.js which responds with
Expand Down Expand Up @@ -86,6 +86,6 @@ Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
If the browser displays the string `Hello, World!`, that indicates
the server is working.

[Command Line Options]: cli.html#cli_command_line_options
[Command-line options]: cli.html#cli_command_line_options
[this guide]: https://nodejs.org/en/download/package-manager/
[web server]: http.html
8 changes: 4 additions & 4 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ HIGH
!CAMELLIA
```

This default can be replaced entirely using the [`--tls-cipher-list`][] command
line switch (directly, or via the [`NODE_OPTIONS`][] environment variable). For
instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS
cipher suite:
This default can be replaced entirely using the [`--tls-cipher-list`][]
command-line switch (directly, or via the [`NODE_OPTIONS`][] environment
variable). For instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4`
the default TLS cipher suite:

```bash
node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' server.js
Expand Down
8 changes: 4 additions & 4 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,20 @@ fn1(); // Emits a deprecation warning with code DEP0001
fn2(); // Does not emit a deprecation warning because it has the same code
```

If either the `--no-deprecation` or `--no-warnings` command line flags are
If either the `--no-deprecation` or `--no-warnings` command-line flags are
used, or if the `process.noDeprecation` property is set to `true` *prior* to
the first deprecation warning, the `util.deprecate()` method does nothing.

If the `--trace-deprecation` or `--trace-warnings` command line flags are set,
If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
or the `process.traceDeprecation` property is set to `true`, a warning and a
stack trace are printed to `stderr` the first time the deprecated function is
called.

If the `--throw-deprecation` command line flag is set, or the
If the `--throw-deprecation` command-line flag is set, or the
`process.throwDeprecation` property is set to `true`, then an exception will be
thrown when the deprecated function is called.

The `--throw-deprecation` command line flag and `process.throwDeprecation`
The `--throw-deprecation` command-line flag and `process.throwDeprecation`
property take precedence over `--trace-deprecation` and
`process.traceDeprecation`.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ added: v8.0.0
* Returns: {integer}

Returns an integer representing a "version tag" derived from the V8 version,
command line flags and detected CPU features. This is useful for determining
command-line flags and detected CPU features. This is useful for determining
whether a [`vm.Script`][] `cachedData` buffer is compatible with this instance
of V8.

Expand Down Expand Up @@ -198,7 +198,7 @@ added: v1.0.0
* `flags` {string}

The `v8.setFlagsFromString()` method can be used to programmatically set
V8 command line flags. This method should be used with care. Changing settings
V8 command-line flags. This method should be used with care. Changing settings
after the VM has started may result in unpredictable behavior, including
crashes and data loss; or it may simply do nothing.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/wasi.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ added:
The `WASI` class provides the WASI system call API and additional convenience
methods for working with WASI-based applications. Each `WASI` instance
represents a distinct sandbox environment. For security purposes, each `WASI`
instance must have its command line arguments, environment variables, and
instance must have its command-line arguments, environment variables, and
sandbox directory structure configured explicitly.

### `new WASI([options])`
Expand All @@ -95,7 +95,7 @@ added:

* `options` {Object}
* `args` {Array} An array of strings that the WebAssembly application will
see as command line arguments. The first argument is the virtual path to the
see as command-line arguments. The first argument is the virtual path to the
WASI command itself. **Default:** `[]`.
* `env` {Object} An object similar to `process.env` that the WebAssembly
application will see as its environment. **Default:** `{}`.
Expand Down
10 changes: 5 additions & 5 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The directory where the CPU profiles generated by
will be placed.
The default value is controlled by the
.Fl -diagnostic-dir .
command line option.
command-line option.
.
.It Fl -cpu-prof-interval
The sampling interval in microseconds for the CPU profiles generated by
Expand Down Expand Up @@ -198,7 +198,7 @@ The directory where the heap profiles generated by
will be placed.
The default value is controlled by the
.Fl -diagnostic-dir .
command line option.
command-line option.
.
.It Fl -heap-prof-interval
The average sampling interval in bytes for the heap profiles generated by
Expand Down Expand Up @@ -319,7 +319,7 @@ will be generated.
The `file` name may be an absolute path. If it is not, the default directory it will
be written to is controlled by the
.Fl -diagnostic-dir .
command line option.
command-line option.
.
.It Fl -report-filename
Name of the file to which the
Expand Down Expand Up @@ -554,7 +554,7 @@ process warnings are silenced.
.It Ev NODE_OPTIONS Ar options...
A space-separated list of command-line
.Ar options ,
which are interpreted as if they had been specified on the command-line before the actual command (so they can be overridden).
which are interpreted as if they had been specified on the command line before the actual command (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
.Fl -print
or a script file.
Expand All @@ -580,7 +580,7 @@ Write process warnings to the given
instead of printing to stderr.
Equivalent to passing
.Fl -redirect-warnings Ar file
on command-line.
on the command line.
.It Ev NODE_REPL_HISTORY Ar file
Path to the
.Ar file
Expand Down

0 comments on commit f6ea3a8

Please sign in to comment.