0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

lib: suppress crypto related env vars in help msg

This commit adds a crypto check to suppress the crypto related
environment variables introduced in Commit
399bb3c95a ("doc: add NODE_DEBUG_NATIVE to API
docs").

Without this check, test/parallel/test-cli-node-print-help.js will fail
when configured --without-ssl, as it some of the descriptions for these
environment variables contain flags that the test is not expecting to find.

PR-URL: https://github.com/nodejs/node/pull/24556
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Daniel Bevenius 2018-11-21 16:23:00 +01:00
parent bb04a8bbf2
commit 567b9f86cc

View File

@ -1,6 +1,7 @@
'use strict';
const { types } = internalBinding('options');
const hasCrypto = Boolean(process.versions.openssl);
const typeLookup = [];
for (const key of Object.keys(types))
@ -33,11 +34,6 @@ const envVars = new Map([
'certificate validation' }],
['NODE_V8_COVERAGE', { helpText: 'directory to output v8 coverage JSON ' +
'to' }],
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
'certificates when used in conjunction with --use-openssl-ca' }],
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
'when used in conjunction with --use-openssl-ca' }],
['UV_THREADPOOL_SIZE', { helpText: 'sets the number of threads used in ' +
'libuv\'s threadpool' }]
].concat(hasIntl ? [
@ -46,6 +42,12 @@ const envVars = new Map([
] : []).concat(hasNodeOptions ? [
['NODE_OPTIONS', { helpText: 'set CLI options in the environment via a ' +
'space-separated list' }]
] : []).concat(hasCrypto ? [
['OPENSSL_CONF', { helpText: 'load OpenSSL configuration from file' }],
['SSL_CERT_DIR', { helpText: 'sets OpenSSL\'s directory of trusted ' +
'certificates when used in conjunction with --use-openssl-ca' }],
['SSL_CERT_FILE', { helpText: 'sets OpenSSL\'s trusted certificate file ' +
'when used in conjunction with --use-openssl-ca' }],
] : []));