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:
Milan Burda 2019-01-07 16:48:27 +01:00 committed by Shelley Vohr
parent 5957ede41a
commit 6f117b8e0c
7 changed files with 135 additions and 38 deletions

View file

@ -1159,6 +1159,20 @@ correctly.
**Note:** This will not affect `process.argv`.
### `app.commandLine.hasSwitch(switch)`
* `switch` String - A command-line switch
Returns `Boolean` - Whether the command-line switch is present.
### `app.commandLine.getSwitchValue(switch)`
* `switch` String - A command-line switch
Returns `String` - The command-line switch value.
**Note:** When the switch is not present, it returns empty string.
### `app.enableSandbox()` _Experimental_ _macOS_ _Windows_
Enables full sandbox mode on the app.