mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/26468 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
30 lines
670 B
JavaScript
30 lines
670 B
JavaScript
'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);
|