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 -L option (--files-without-match) #779

Closed
hyperknot opened this issue Feb 7, 2018 · 8 comments
Closed

add -L option (--files-without-match) #779

hyperknot opened this issue Feb 7, 2018 · 8 comments
Labels
invalid An issue that is not actually a bug or a feature that already exists. question An issue that is lacking clarity on one or more points.

Comments

@hyperknot
Copy link

What version of ripgrep are you using?

0.7.1

What operating system are you using ripgrep on?

macOS 10.13.3

Describe your question, feature request, or bug.

Feature request: add support for -L or --files-without-match.

This happens to be the same switch across grep, ack, and ag.

I didn't find any such function in ripgrep, at least not in the documentation.

@BurntSushi
Copy link
Owner

It already exists:

$ rg -h | rg files-without-match
        --files-without-match               Only print the paths that contain zero matches.

@BurntSushi BurntSushi added invalid An issue that is not actually a bug or a feature that already exists. question An issue that is lacking clarity on one or more points. labels Feb 7, 2018
@hyperknot
Copy link
Author

I looked for "not", "don't", "invert" words but I didn't find this one. It's ironic as I got the --files-without-match from grep manual.
So any reason why not to support -L as well?

@BurntSushi
Copy link
Owner

BurntSushi commented Feb 7, 2018

@hyperknot Because it's already used to tell ripgrep to follow symbolic links, which is consistent with find's flag for the same behavior. This is also documented:

$ rg -h | rg -e -L
    -L, --follow                            Follow symbolic links.

@BurntSushi
Copy link
Owner

ag uses -L for --files-without-match, and also has a -f/--follow flag, but -f is used in ripgrep (and grep) for searching for many patterns from a file, which is a feature that ag does not have.

@BurntSushi
Copy link
Owner

grep uses -R for following symbolic links during recursive search, where -r is the normal variant. In hindsight, it is plausible that ripgrep should have used -R as well (although the lowercase -r variant doesn't make sense since that's ripgrep's default behavior), which would have left -L open for --files-without-match. However, that is certainly not happening now.

My feeling is that --files-without-match isn't used too often, and adding a short flag for it other than -L would confuse matters even more. But if someone has a better idea, I'm all ears.

@hyperknot
Copy link
Author

I see, I agree there shouldn't be a new short switch then.

@hyperknot
Copy link
Author

Maybe just add the words "invert" or "not" or something like this to the help, as the other options use these words for negation.

@BurntSushi
Copy link
Owner

@hyperknot I can do that. It's in my local changes which should get pushed out soon and will be in the next release.

BurntSushi added a commit that referenced this issue Feb 7, 2018
This adds a couple common keywords to the documentation.

Fixes #779
BurntSushi added a commit that referenced this issue Feb 10, 2018
This adds a couple common keywords to the documentation.

Fixes #779
BurntSushi added a commit that referenced this issue Feb 10, 2018
This adds a couple common keywords to the documentation.

Fixes #779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid An issue that is not actually a bug or a feature that already exists. question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

2 participants