@@ -202,6 +202,7 @@ function format(
202
202
203
203
function print ( stream ) {
204
204
const { options, aliases } = getCLIOptionsInfo ( ) ;
205
+ const console = require ( 'internal/console/global' ) ;
205
206
206
207
// Use 75 % of the available width, and at least 70 characters.
207
208
const width = MathMax ( 70 , ( stream . columns || 0 ) * 0.75 ) ;
@@ -212,21 +213,22 @@ function print(stream) {
212
213
'(default if no file name is provided, ' +
213
214
'interactive mode if a tty)' } ) ;
214
215
options . set ( '--' , { helpText : 'indicate the end of node options' } ) ;
215
- stream . write (
216
+ let helpText = (
216
217
'Usage: node [options] [ script.js ] [arguments]\n' +
217
218
' node inspect [options] [ script.js | host:port ] [arguments]\n\n' +
218
219
'Options:\n' ) ;
219
- stream . write ( indent ( format ( {
220
+ helpText += ( indent ( format ( {
220
221
options, aliases, firstColumn, secondColumn,
221
222
} ) , 2 ) ) ;
222
223
223
- stream . write ( '\nEnvironment variables:\n' ) ;
224
+ helpText += ( '\nEnvironment variables:\n' ) ;
224
225
225
- stream . write ( format ( {
226
+ helpText += ( format ( {
226
227
options : envVars , firstColumn, secondColumn,
227
228
} ) ) ;
228
229
229
- stream . write ( '\nDocumentation can be found at https://nodejs.org/\n' ) ;
230
+ helpText += ( '\nDocumentation can be found at https://nodejs.org/' ) ;
231
+ console . log ( helpText ) ;
230
232
}
231
233
232
234
prepareMainThreadExecution ( ) ;
0 commit comments