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
This commit is contained in:
parent
5957ede41a
commit
6f117b8e0c
7 changed files with 135 additions and 38 deletions
15
spec/fixtures/api/command-line/main.js
vendored
Normal file
15
spec/fixtures/api/command-line/main.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
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()
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue