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

Improve documentation for --only flag #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gokcelb
Copy link

@gokcelb gokcelb commented Dec 13, 2024

Provide examples about how --only flag works in README.md and flag explanation.

There was no information about what kind of format to pass to the --only flag and this caused some issues with running complexity as expected. The examples provided via this change show the correct format.

Provide examples about how --only flag works in README.md and
flag explanation.

There was no information about what kind of format to pass to the --only
flag and this caused some issues with running complexity as expected.
The examples provided via this change show the correct format.
@joshuaclayton
Copy link
Contributor

I agree that the documentation is a good first step; I'd also consider adjusting the flag name (perhaps in a separate PR) so it's more clear what the flag is filtering against, and do a minor version bump since it's still pre-1.0.

I'd reviewed rg, which allows filtering based on a --glob flag. This isn't quite what we'd want (it supports regular expressions and is more permissive than what we'd want to start with, I think). fd, on the other hand, does provide something closer: -e/--extension. It can be called as fd -e md -e js for multiple extensions

So, we may want to adjust our standard case only to extension (with the e shorthand). This:

  1. improves clarity on what the flag does
  2. mirrors another CLI tool that allows filtering by multiple extensions

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.

2 participants