diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-05-14 13:09:27 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-09-21 07:18:24 +0200 |
commit | 56493bf1ebfab3ec102fe017f30fa4f81ba6a256 (patch) | |
tree | 6984303225029fee729329e84eb69ca75542a9bf /doc | |
parent | 408e8ce22ce7436e88a9977b4dc99fc3c431fc67 (diff) | |
download | android-node-v8-56493bf1ebfab3ec102fe017f30fa4f81ba6a256.tar.gz android-node-v8-56493bf1ebfab3ec102fe017f30fa4f81ba6a256.tar.bz2 android-node-v8-56493bf1ebfab3ec102fe017f30fa4f81ba6a256.zip |
tools: add bash completion for node
This commit adds a --completion-bash option to node which can be
sourced to provide bash code completion for node options.
Usage:
$ node --completion-bash > node_bash_completion
$ source node_bash_completion
$ node --[tab]
PR-URL: https://github.com/nodejs/node/pull/20713
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/cli.md | 11 | ||||
-rw-r--r-- | doc/node.1 | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md index 8adb33efb7..3f5441b82e 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -52,6 +52,17 @@ If this flag is passed, the behavior can still be set to not abort through [`process.setUncaughtExceptionCaptureCallback()`][] (and through usage of the `domain` module that uses it). +### `--completion-bash` +<!-- YAML +added: REPLACEME +--> + +Print source-able bash completion script for Node.js. +```console +$ node --completion-bash > node_bash_completion +$ source node_bash_completion +``` + ### `--enable-fips` <!-- YAML added: v6.0.0 diff --git a/doc/node.1 b/doc/node.1 index 8e6616ad96..ad46d58d1f 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -75,6 +75,9 @@ the next argument will be used as a script filename. .It Fl -abort-on-uncaught-exception Aborting instead of exiting causes a core file to be generated for analysis. . +.It Fl -completion-bash +Print source-able bash completion script for Node.js. +. .It Fl -enable-fips Enable FIPS-compliant crypto at startup. Requires Node.js to be built with |