Skip to content
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

Merged
merged 5 commits into from Jan 7, 2019

Conversation

@miniak
Copy link
Contributor

commented Jan 4, 2019

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

Release Notes

Notes: Added app.commandLine.hasSwitch() / app.commandLine.getSwitchValue()

@miniak miniak requested review from as code owners Jan 4, 2019

@miniak miniak force-pushed the miniak/commandline-api branch from 4e9e90a to d9418fb Jan 4, 2019

@miniak miniak self-assigned this Jan 4, 2019

@miniak miniak force-pushed the miniak/commandline-api branch from d9418fb to c2de926 Jan 4, 2019

@miniak miniak force-pushed the miniak/commandline-api branch from c2de926 to 7983527 Jan 5, 2019

@miniak miniak force-pushed the miniak/commandline-api branch from 7983527 to cd5f1c4 Jan 5, 2019

@deepak1556
Copy link
Member

left a comment

LGTM

Show resolved Hide resolved lib/browser/api/app.js Outdated

Returns `String` - The command-line switch value.

**Note:** When the switch is not present, it returns empty string.

This comment has been minimized.

Copy link
@alexeykuzmin

alexeykuzmin Jan 7, 2019

Contributor

This is sad.

This comment has been minimized.

Copy link
@miniak

miniak Jan 7, 2019

Author Contributor

that's how the chromium API behaves

Show resolved Hide resolved lib/browser/api/app.js Outdated
@alexeykuzmin
Copy link
Contributor

left a comment

See a minor question above.

@ppontes

ppontes approved these changes Jan 7, 2019

Copy link
Member

left a comment

LGTM

@codebytere codebytere merged commit 6f117b8 into master Jan 7, 2019

25 of 27 checks passed

electron-arm-testing Build #20190107.7 has failed
Details
Artifact Comparison Changes Detected
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing-tests Your tests passed on CircleCI!
Details
electron-arm64-testing Build #20190107.6 succeeded
Details
electron-lint Build #20190107.10 succeeded
Details
electron-mas-testing Build #20190107.10 succeeded
Details
electron-osx-testing Build #20190107.9 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Jan 7, 2019

Release Notes Persisted

Added app.commandLine.hasSwitch() / app.commandLine.getSwitchValue()

@codebytere codebytere deleted the miniak/commandline-api branch Jan 7, 2019

andrewkisliakov-citrix added a commit to andrewkisliakov-citrix/electron that referenced this pull request Jan 22, 2019

feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValu…
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.