| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2bd7437 commit 59b5e77
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | const { internalBinding, NativeModule } = loaderExports; | |
| 20 | 20 | ||
| 21 | - let getOptionValue; | ||
| 21 | + const { getOptionValue } = NativeModule.require('internal/options'); | ||
| 22 | 22 | ||
| 23 | 23 | function startup() { | |
| 24 | 24 | setupTraceCategoryState(); | |
@@ -160,18 +160,6 @@ function startup() { | |||
| 160 | 160 | NativeModule.require('internal/inspector_async_hook').setup(); | |
| 161 | 161 | } | |
| 162 | 162 | ||
| 163 | - getOptionValue = NativeModule.require('internal/options').getOptionValue; | ||
| 164 | - | ||
| 165 | - if (getOptionValue('--help')) { | ||
| 166 | - NativeModule.require('internal/print_help').print(process.stdout); | ||
| 167 | - return; | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - if (getOptionValue('--completion-bash')) { | ||
| 171 | - NativeModule.require('internal/bash_completion').print(process.stdout); | ||
| 172 | - return; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | 163 | // If the process is spawned with env NODE_CHANNEL_FD, it's probably | |
| 176 | 164 | // spawned by our child_process module, then initialize IPC. | |
| 177 | 165 | // This attaches some internal event listeners and creates: | |
@@ -376,6 +364,18 @@ function startExecution() { | |||
| 376 | 364 | return; | |
| 377 | 365 | } | |
| 378 | 366 | ||
| 367 | + // node --help | ||
| 368 | + if (getOptionValue('--help')) { | ||
| 369 | + NativeModule.require('internal/print_help').print(process.stdout); | ||
| 370 | + return; | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + // e.g. node --completion-bash >> ~/.bashrc | ||
| 374 | + if (getOptionValue('--completion-bash')) { | ||
| 375 | + NativeModule.require('internal/bash_completion').print(process.stdout); | ||
| 376 | + return; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | 379 | // `node --prof-process` | |
| 380 | 380 | if (getOptionValue('--prof-process')) { | |
| 381 | 381 | NativeModule.require('internal/v8_prof_processor'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments