zsh/.zsh/completion/_node
#compdef node
# ------------------------------------------------------------------------------
# Copyright (c) 2018 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Node.js v10.4.1 (https://nodejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
# * Nicholas Penree (https://github.com/drudge)
# * Masafumi Koba (https://github.com/ybiquitous)
#
# ------------------------------------------------------------------------------
_node_files() {
_files -g "*.(js|mjs)"
}
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'-[script read from stdin (default; interactive mode if a tty)]' \
'--[indicate the end of node options]' \
'--abort-on-uncaught-exception[aborting instead of exiting causes a core file to be generated for analysis]' \
'--experimental-modules[experimental ES Module support and caching modules]' \
'--experimental-repl-await[experimental await keyword support in REPL]' \
'--experimental-vm-modules[experimental ES Module support in vm module]' \
'--icu-data-dir=[set ICU data load path to dir (overrides NODE_ICU_DATA) note: linked-in ICU data is present]: :_directories' \
'--inspect-brk=-[activate inspector on host:port and break at start of user script]:[host\:]port' \
'--inspect-port=[set host:port for inspector]:[host\:]port' \
'--inspect=-[activate inspector on host:port (default: 127.0.0.1:9229)]:[host\:]port' \
'--napi-modules[load N-API modules (no-op - option kept for compatibility)]' \
'--no-deprecation[silence deprecation warnings]' \
'--no-force-async-hooks-checks[disable checks for async_hooks]' \
'--no-warnings[silence all process warnings]' \
'--openssl-config=[load OpenSSL configuration from the specified file (overrides OPENSSL_CONF)]:file:_files' \
'--pending-deprecation[emit pending deprecation warnings]' \
'--preserve-symlinks[preserve symbolic links when resolving]' \
'--preserve-symlinks-main[preserve symbolic links when resolving the main module]' \
'--prof[generate V8 profiler output]' \
'--prof-process[process V8 profiler output generated using --prof]' \
'--redirect-warnings=[write warnings to file instead of stderr]: :_files' \
'--throw-deprecation[throw an exception on deprecations]' \
'--tls-cipher-list=[use an alternative default TLS cipher list]:cipher list string' \
'--trace-deprecation[show stack traces on deprecations]' \
'--trace-event-categories[comma separated list of trace event categories to record]: :{_values -s , categories node node.async_hooks node.bootstrap node.perf node.perf.usertiming node.perf.timerify node.fs.sync node.vm.script v8}' \
'--trace-event-file-pattern[Template string specifying the filepath for the trace-events data, it supports ${rotation} and ${pid} log-rotation id. %2$u is the pid.]:template string' \
'--trace-events-enabled[track trace events]' \
'--trace-sync-io[show stack trace when use of sync IO is detected after the first tick]' \
'--trace-warnings[show stack traces on process warnings]' \
'--track-heap-objects[track heap object allocations for heap snapshots]' \
'--use-bundled-ca[use bundled CA store (default)]' \
"--use-openssl-ca[use OpenSSL's default CA store]" \
'(- 1 *)--v8-options[print v8 command line options]' \
"--v8-pool-size=[set v8's thread pool size]:number" \
'--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \
{-c,--check}'[syntax check script without executing]' \
'(- 1 *)'{-e,--eval}'[evaluate script]:inline JavaScript' \
'(- 1 *)'{-h,--help}'[print node command line options]' \
{-i,--interactive}'[always enter the REPL even if stdin does not appear to be a terminal]' \
'(- 1 *)'{-p,--print}'[evaluate script and print result]:inline JavaScript' \
'*'{-r,--require}'[module to preload (option can be repeated)]: :_node_files' \
'(- 1 *)'{-v,--version}'[print Node.js version]' \
'*: :_node_files' && ret=0
_values 'commands' \
'inspect[enable inspector for debugging]' && ret=0
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et