mirror of https://github.com/atom/atom.git
fix: Include `-v`/`--version` in the main usage message
This commit is contained in:
parent
98ab593f46
commit
19b28ed492
|
@ -12,15 +12,10 @@ const CSON = require('season');
|
|||
const yargs = require('yargs');
|
||||
const { app } = require('electron');
|
||||
|
||||
const version = `Atom : ${app.getVersion()}
|
||||
Electron: ${process.versions.electron}
|
||||
Chrome : ${process.versions.chrome}
|
||||
Node : ${process.versions.node}`;
|
||||
|
||||
const args = yargs(process.argv)
|
||||
.alias('v', 'version')
|
||||
.version(version)
|
||||
// Don't handle --help or --version here; they will be handled later.
|
||||
.help(false)
|
||||
.version(false)
|
||||
.alias('d', 'dev')
|
||||
.alias('t', 'test')
|
||||
.alias('r', 'resource-path').argv;
|
||||
|
|
|
@ -133,7 +133,16 @@ module.exports = function parseCommandLine(processArgs) {
|
|||
'Enable low-level logging messages from Electron.'
|
||||
);
|
||||
options.boolean('uri-handler');
|
||||
options
|
||||
.version(
|
||||
dedent`Atom : ${version}
|
||||
Electron: ${process.versions.electron}
|
||||
Chrome : ${process.versions.chrome}
|
||||
Node : ${process.versions.node}`
|
||||
)
|
||||
.alias('v', 'version');
|
||||
|
||||
// NB: if --help or --version are given, this also displays the relevant message and exits
|
||||
let args = options.argv;
|
||||
|
||||
// If --uri-handler is set, then we parse NOTHING else
|
||||
|
|
Loading…
Reference in New Issue