New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValue() #16282
Conversation
4e9e90a
to
d9418fb
Compare
d9418fb
to
c2de926
Compare
c2de926
to
7983527
Compare
7983527
to
cd5f1c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
Returns `String` - The command-line switch value. | ||
|
||
**Note:** When the switch is not present, it returns empty string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's how the chromium API behaves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See a minor question above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Release Notes Persisted
|
…e() (electron#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
Description of Change
Expose the following APIs, which we are already using internally in lib/renderer/init.js
app.commandLine.hasSwitch()
app.commandLine.getSwitchValue()
These methods are useful for parsing command-line options in robust way without having to use external libraries.
Checklist
npm test
passesRelease Notes
Notes: Added
app.commandLine.hasSwitch()
/app.commandLine.getSwitchValue()