electron/spec/fixtures/api/command-line/main.js
Milan Burda 6f117b8e0c feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValue() (#16282)
* feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValue()

* add more tests

* refactor: move appendSwitch / appendArgument to command_line module

* replace AppendSwitchASCII with AppendSwitchNative

* remove castArgs
2019-01-07 07:48:27 -08:00

15 lines
317 B
JavaScript

const { app } = require('electron')
app.on('ready', () => {
const payload = {
hasSwitch: app.commandLine.hasSwitch('foobar'),
getSwitchValue: app.commandLine.getSwitchValue('foobar')
}
process.stdout.write(JSON.stringify(payload))
process.stdout.end()
setImmediate(() => {
app.quit()
})
})