From 12fda31219f4c7cc95d7b27f25de5d86ba3086fb Mon Sep 17 00:00:00 2001 From: rsteube Date: Thu, 21 Sep 2023 00:59:40 +0200 Subject: [PATCH] environment: added node --- pkg/actions/env/node.go | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkg/actions/env/node.go diff --git a/pkg/actions/env/node.go b/pkg/actions/env/node.go new file mode 100644 index 0000000000..07a79b48d8 --- /dev/null +++ b/pkg/actions/env/node.go @@ -0,0 +1,47 @@ +package env + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace/pkg/style" +) + +func init() { + _bool := carapace.ActionValuesDescribed("0", "disabled", "1", "enabled").StyleF(style.ForKeyword) + knownVariables["node"] = variables{ + Condition: checkPath("node"), + Names: map[string]string{ + "NODE_DEBUG": "Comma-separated list of core modules that should print debug information", + "NODE_DEBUG_NATIVE": "Comma-separated list of C++ core modules that should print debug information", + "NODE_DISABLE_COLORS": "When set to 1, colors will not be used in the REPL", + "NODE_EXTRA_CA_CERTS": "When set, the well-known “root” CAs will be extended with the extra certificates in file", + "NODE_ICU_DATA": "Data path for ICU (Intl object) data", + "NODE_NO_WARNINGS": "When set to 1, process warnings are silenced", + "NODE_OPTIONS": "A space-separated list of command-line options", + "NODE_PATH": "A colon-separated list of directories prefixed to the module search path", + "NODE_PENDING_DEPRECATION": "When set to 1, emit pending deprecation warnings", + "NODE_PRESERVE_SYMLINKS": "When set to 1, the module loader preserves symbolic links when resolving and caching modules", + "NODE_REDIRECT_WARNINGS": "Write process warnings to the given file instead of printing to stderr", + "NODE_REPL_HISTORY": "Path to the file used to store persistent REPL history", + "NODE_REPL_EXTERNAL_MODULE": "Path to a Node.js module which will be loaded in place of the built-in REPL", + "NODE_SKIP_PLATFORM_CHECK": "When set to 1, the check for a supported platform is skipped during Node.js startup", + "NODE_TLS_REJECT_UNAUTHORIZED": "When set to 0, TLS certificate validation is disabled", + "NODE_V8_COVERAGE": "When set, Node.js writes JavaScript code coverage information to dir", + "OPENSSL_CONF": "Load an OpenSSL configuration file on startup", + "SSL_CERT_DIR": "If --use-openssl-ca is enabled, this overrides and sets OpenSSL's directory containing trusted certificates", + "SSL_CERT_FILE": "If --use-openssl-ca is enabled, this overrides and sets OpenSSL's file containing trusted certificates", + "TZ": "Specify the timezone configuration", + "UV_THREADPOOL_SIZE": "Sets the number of threads used in libuv's threadpool to size", + }, + Completion: map[string]carapace.Action{ + // TODO more completions + "NODE_DISABLE_COLORS": _bool, + "NODE_NO_WARNINGS": _bool, + "NODE_PATH": carapace.ActionDirectories().List(":"), + "NODE_PENDING_DEPRECATION": _bool, + "NODE_SKIP_PLATFORM_CHECK": _bool, + "NODE_TLS_REJECT_UNAUTHORIZED": _bool, + "SSL_CERT_DIR": carapace.ActionDirectories(), + }, + } + +}