sindresorhus / capture-website-cli

Capture screenshots of websites from the command-line
MIT License
821 stars 42 forks source link

Add `--no-block-ads` flag #39

Closed jopemachine closed 2 years ago

jopemachine commented 2 years ago

I added no-block-ads flag added from https://github.com/sindresorhus/capture-website/pull/98.

But I encountered a problem while I'm working on this.

This flag name starts with no, and that's why it is treated as 'negation' flag in yargs-parser

This resulted in the below situation.

// 'no-block-ads' flag is true ('block-ad' is false)
$ node cli.js some_url --output=a.png --overwrite --no-block-ads=true

// 'no-block-ads' flag is false ('block-ad' is true), which is different from users' expectation.
$ node cli.js some_url --output=a.png --overwrite --no-block-ads

I'm a little confusing... May I ask how should I handle this?

jopemachine commented 2 years ago

Oh, never mind.. I think I found a solution in this PR