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

CLI arguments #183

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

alanpoulain
Copy link

I tried to handle PhantomJS arguments the better way I could think of.
I you have better ideas, please tell me.

@@ -35,6 +35,12 @@ function PDF (html, options) {
if (this.options.filename) this.options.filename = path.resolve(this.options.filename)
if (!this.options.phantomPath) this.options.phantomPath = phantomjs && phantomjs.path
this.options.phantomArgs = this.options.phantomArgs || []
this.options.phantomArgs = this.options.phantomArgs.map(function (elt) {
if (elt.substring(0, 2) !== '--') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO that's too much magic. I'd support --phantomArgs "--ignore-ssl-errors=yes". Then you'll also get a string in here and we can just split it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, it would be better but unfortunately it does not work like this.
The double quotes are not kept and yargs-parser consider it as a normal argument.

@acrolink
Copy link

Is this feature committed to latest release?

@alanpoulain
Copy link
Author

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants