Skip to content

Commit

Permalink
lib: suppress crypto related env vars in help msg
Browse files Browse the repository at this point in the history
This commit adds a crypto check to suppress the crypto related
environment variables introduced in Commit
399bb3c ("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: #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>
  • Loading branch information
danbev authored and rvagg committed Nov 28, 2018
1 parent 5a47c2e commit 3df8633
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/internal/print_help.js
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -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 ? [
Expand All @@ -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' }],
] : []));


Expand Down

0 comments on commit 3df8633

Please sign in to comment.