diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-02-03 06:47:26 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-12-26 00:15:41 +0300 |
commit | 403c84a1cf964a24608a79c2952230270b6d1ca8 (patch) | |
tree | 419783e0944b6f7a61940765589d114d1a75769f /lib | |
parent | 486ffa2abcee3be1210044a1654df2fb50eaa42f (diff) |
src: port --bash-completion to C++
So that it gets handle earlier and faster during the bootstrap
process.
Drive-by fixes:
- Remove `[has_eval_string]` and `[ssl_openssl_cert_store]` from
the completion output
- Set `kProfProcess` execution mode for `--prof-process` instead
of `kPrintBashProcess` which is removed in this patch.
- Append new line to the end of the output of --bash-completion
PR-URL: https://github.com/nodejs/node/pull/25901
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/main/print_bash_completion.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/internal/main/print_bash_completion.js b/lib/internal/main/print_bash_completion.js deleted file mode 100644 index 41ebf0c6063..00000000000 --- a/lib/internal/main/print_bash_completion.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const { options, aliases } = require('internal/options'); - -const { - prepareMainThreadExecution -} = require('internal/bootstrap/pre_execution'); - -function print(stream) { - const all_opts = [...options.keys(), ...aliases.keys()]; - - stream.write(`_node_complete() { - local cur_word options - cur_word="\${COMP_WORDS[COMP_CWORD]}" - if [[ "\${cur_word}" == -* ]] ; then - COMPREPLY=( $(compgen -W '${all_opts.join(' ')}' -- "\${cur_word}") ) - return 0 - else - COMPREPLY=( $(compgen -f "\${cur_word}") ) - return 0 - fi -} -complete -F _node_complete node node_g`); -} - -prepareMainThreadExecution(); - -markBootstrapComplete(); - -print(process.stdout); |