File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,10 @@ const CSON = require('season');
12
12
const yargs = require ( 'yargs' ) ;
13
13
const { app } = require ( 'electron' ) ;
14
14
15
- const version = `Atom : ${ app . getVersion ( ) }
16
- Electron: ${ process . versions . electron }
17
- Chrome : ${ process . versions . chrome }
18
- Node : ${ process . versions . node } ` ;
19
-
20
15
const args = yargs ( process . argv )
21
- . alias ( 'v' , 'version' )
22
- . version ( version )
16
+ // Don't handle --help or --version here; they will be handled later.
23
17
. help ( false )
18
+ . version ( false )
24
19
. alias ( 'd' , 'dev' )
25
20
. alias ( 't' , 'test' )
26
21
. alias ( 'r' , 'resource-path' ) . argv ;
Original file line number Diff line number Diff line change @@ -133,7 +133,16 @@ module.exports = function parseCommandLine(processArgs) {
133
133
'Enable low-level logging messages from Electron.'
134
134
) ;
135
135
options . boolean ( 'uri-handler' ) ;
136
+ options
137
+ . version (
138
+ dedent `Atom : ${ version }
139
+ Electron: ${ process . versions . electron }
140
+ Chrome : ${ process . versions . chrome }
141
+ Node : ${ process . versions . node } `
142
+ )
143
+ . alias ( 'v' , 'version' ) ;
136
144
145
+ // NB: if --help or --version are given, this also displays the relevant message and exits
137
146
let args = options . argv ;
138
147
139
148
// If --uri-handler is set, then we parse NOTHING else
You can’t perform that action at this time.
0 commit comments