Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--filter not working properly with packages containing hyphens #759

Closed
obihill opened this issue Nov 8, 2020 · 1 comment
Closed

--filter not working properly with packages containing hyphens #759

obihill opened this issue Nov 8, 2020 · 1 comment

Comments

@obihill
Copy link

obihill commented Nov 8, 2020

I'm using node@10.13.0 and npm-check-updates@9.2.4.

The --filter flag appears to have an issue when using it with hyphenated package names.

I was trying to use this on chrome-launcher and puppeteer using the following command:

ncu -f chrome-launcher puppeteer

Only 1 package shows up i.e. puppeteer. However, when I use commas to delimit like this:

ncu -f chrome-launcher,puppeteer

Both packages show up. 'Switching to commas for now, but wanted to bring this to your attention for a fix.

@raineorshine
Copy link
Owner

I was trying to use this on chrome-launcher and puppeteer using the following command:

ncu -f chrome-launcher puppeteer

Options are space-delimited, so what's happening here is that you are specifying a --filter option of chrome-launcher and a regular argument of puppeteer. Since regular arguments are used to specify a filter also, it is overriding your -f option. If you reverse the order you will see that chrome-launcher overrides puppeteer. You can use either of the following to achieve your aim:

  • ncu chrome-launcher puppeteer
  • ncu -f "chrome-launcher puppeteer"

It's an easy mistake to make though, so I should probably require --filter OR args but not both.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants