https://www.electronjs.org/docs/api/command-line states that
(commandLine.appendSwitch(...)
) This will not affect process.argv. The intended usage of this function is to control Chromium's behavior.
As such, only the appp.commandLine.getSwitchValue
as mentioned in other comments allows you to get these command line switches
In addition to the use of switches as command line parameters, the use of arguments is also supported. Arguments take the form of "someData" in the final command line, where switches take the form "--namedParameter=someData".
In code, commandLine.appendArgument(value)
is used to add the argument. These arguments are given before all switches in the generated command line.
They are also intended to affect Chromium's behavior. Again:
(commandLine.appendArgument(value)
) Note: This will not affect process.argv. The intended usage of this function is to control Chromium's behavior.
Since there is no key for the parameter, there does not appear to be a way to directly read it from code as there is with a switch.
https://www.electronjs.org/docs/api/command-line-switches gives a list of supported switches.