support --abi
This commit is contained in:
parent
f4c1cd11a0
commit
7dcb939338
1 changed files with 9 additions and 2 deletions
|
@ -8,11 +8,14 @@ const url = require('url')
|
||||||
|
|
||||||
// Parse command line options.
|
// Parse command line options.
|
||||||
const argv = process.argv.slice(1)
|
const argv = process.argv.slice(1)
|
||||||
const option = { file: null, help: null, version: null, webdriver: null, modules: [] }
|
const option = { file: null, help: null, version: null, abi: null, webdriver: null, modules: [] }
|
||||||
for (let i = 0; i < argv.length; i++) {
|
for (let i = 0; i < argv.length; i++) {
|
||||||
if (argv[i] === '--version' || argv[i] === '-v') {
|
if (argv[i] === '--version' || argv[i] === '-v') {
|
||||||
option.version = true
|
option.version = true
|
||||||
break
|
break
|
||||||
|
} else if (argv[i] === '--abi') {
|
||||||
|
option.abi = true
|
||||||
|
break
|
||||||
} else if (argv[i].match(/^--app=/)) {
|
} else if (argv[i].match(/^--app=/)) {
|
||||||
option.file = argv[i].split('=')[1]
|
option.file = argv[i].split('=')[1]
|
||||||
break
|
break
|
||||||
|
@ -304,6 +307,9 @@ if (option.file && !option.webdriver) {
|
||||||
} else if (option.version) {
|
} else if (option.version) {
|
||||||
console.log('v' + process.versions.electron)
|
console.log('v' + process.versions.electron)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
} else if (option.abi) {
|
||||||
|
console.log(process.versions.modules)
|
||||||
|
process.exit(0)
|
||||||
} else if (option.help) {
|
} else if (option.help) {
|
||||||
const helpMessage = `Electron ${process.versions.electron} - Build cross platform desktop apps with JavaScript, HTML, and CSS
|
const helpMessage = `Electron ${process.versions.electron} - Build cross platform desktop apps with JavaScript, HTML, and CSS
|
||||||
|
|
||||||
|
@ -321,7 +327,8 @@ if (option.file && !option.webdriver) {
|
||||||
-h, --help Print this usage message.
|
-h, --help Print this usage message.
|
||||||
-i, --interactive Open a REPL to the main process.
|
-i, --interactive Open a REPL to the main process.
|
||||||
-r, --require Module to preload (option can be repeated)
|
-r, --require Module to preload (option can be repeated)
|
||||||
-v, --version Print the version.`
|
-v, --version Print the version.
|
||||||
|
--abi Print the application binary interface.`
|
||||||
console.log(helpMessage)
|
console.log(helpMessage)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
} else if (option.interactive) {
|
} else if (option.interactive) {
|
||||||
|
|
Loading…
Reference in a new issue