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

Add shortened alias for --filter #3467

Closed
1 task
nategreen opened this issue May 20, 2021 · 7 comments · Fixed by #4342
Closed
1 task

Add shortened alias for --filter #3467

nategreen opened this issue May 20, 2021 · 7 comments · Fixed by #4342
Milestone

Comments

@nategreen
Copy link

nategreen commented May 20, 2021

Describe the user story

I type --filter quite a bit in my monorepo. Some percentage of the time, I type --filter instead. Plus, it's just kind of lengthy when I also need to type a package name / folder / etc. I'd love to just type something shorter, like I can for -f (force) or pnpm i.

Describe the solution you'd like

I'm not sure what would be a suitable letter for it. Since --force is taking up -f, maybe -F would be a good shortened version.

Describe the drawbacks of your solution

It's fairly close to -f for --force and if you mess it up that could have bad consequences.

Describe alternatives you've considered

Maybe -i because it's the next letter in "filter", or -m that might mentally map to "match."

@zkochan
Copy link
Member

zkochan commented May 20, 2021

I would probably use -f but it will be a breaking change.

@zkochan zkochan added this to the v7.x milestone May 23, 2021
@zkochan
Copy link
Member

zkochan commented Feb 8, 2022

@pnpm/collaborators should we make -f a short alias of --filter instead of --force? --force is not frequently used. But --filter is really frequent.

@zkochan zkochan modified the milestones: v7.x, v7.0 Feb 8, 2022
@kenrick95
Copy link
Member

Mentally, it's true that -f generally meant --force, however if it's not frequently used in pnpm, then I'm fine with changing it to --filter.

@sodatea
Copy link
Sponsor Member

sodatea commented Feb 8, 2022

The only documented usage of --force is in pnpm publish: https://pnpm.io/cli/publish#--force
In npm there's a --force flag for npm install and npm init. pnpm also supports it in these commands.

So I think it's fine to make -f alias for --filter in most cases, but for these 3 commands, it would be ambiguous.

@nategreen
Copy link
Author

nategreen commented Feb 8, 2022

Sorry to butt in, just throwing this out there though because I agree changing -f for install and such might be ambiguous/unexpected. What about:

  • providing an argument to --recursive / -r?
  • changing the name to something that doesn't start with F, e.g. --select, --packages, etc.?

@kenrick95
Copy link
Member

changing the name to something that doesn't start with F

As some examples, Lerna & Turborepo uses --scope (with no shortcut)

@zkochan
Copy link
Member

zkochan commented Feb 16, 2022

Is big -F OK? Here is a PR: #4342

zkochan added a commit that referenced this issue Feb 16, 2022
zkochan added a commit that referenced this issue Feb 21, 2022
@zkochan zkochan modified the milestones: v7.0, v6.32 Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants