diff --git a/default_app/main.js b/default_app/main.js index 31c55ac95fcd..89a6d2b097cb 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -7,19 +7,16 @@ const url = require('url') // Parse command line options. const argv = process.argv.slice(1) -const option = { file: null, help: null, version: null, abi: null, webdriver: null, modules: [] } +const option = { file: null, help: null, default: null, version: null, webdriver: null, modules: [] } for (let i = 0; i < argv.length; i++) { if (argv[i] === '--version' || argv[i] === '-v') { option.version = true break - } else if (argv[i] === '--abi') { - option.abi = true - break } else if (argv[i].match(/^--app=/)) { option.file = argv[i].split('=')[1] break - } else if (argv[i] === '--help' || argv[i] === '-h') { - option.help = true + } else if (argv[i] === '--default' || argv[i] === '-d') { + option.default = true break } else if (argv[i] === '--interactive' || argv[i] === '-i') { option.interactive = true @@ -327,16 +324,17 @@ if (option.file && !option.webdriver) { } else if (option.version) { console.log('v' + process.versions.electron) process.exit(0) -} else if (option.abi) { - console.log(process.versions.modules) - process.exit(0) -} else if (option.help) { - const helpMessage = `Electron ${process.versions.electron} - Build cross platform desktop apps with JavaScript, HTML, and CSS +} else if (option.default) { + const indexPath = path.join(__dirname, '/index.html') + loadApplicationByUrl(`file://${indexPath}`); +} else if (option.interactive) { + startRepl() +} else { + const welcomeMessage = `Electron ${process.versions.electron} - Build cross platform desktop apps with JavaScript, HTML, and CSS Usage: electron [options] [path] - A path to an Electron app may be specified. The path must be one of the following: - + A path to an Electron app may be specified. It must be one of the following: - index.js file. - Folder containing a package.json file. - Folder containing an index.js file. @@ -344,16 +342,10 @@ if (option.file && !option.webdriver) { - http://, https://, or file:// URL. Options: - -h, --help Print this usage message. + -d, --default Run the default bundled Electron app. -i, --interactive Open a REPL to the main process. -r, --require Module to preload (option can be repeated) - -v, --version Print the version. - --abi Print the application binary interface.` - console.log(helpMessage) + -v, --version Print the version.` + console.log(welcomeMessage) process.exit(0) -} else if (option.interactive) { - startRepl() -} else { - const indexPath = path.join(__dirname, '/index.html') - loadApplicationByUrl(`file://${indexPath}`) }