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

pcre2grep should have an option to null-terminate filenames output with --files-with-matches and --files-without-match options #137

Closed
zsanter opened this issue Jul 24, 2022 · 2 comments

Comments

@zsanter
Copy link

zsanter commented Jul 24, 2022

GNU grep has -Z and --null. git grep has -z and --null. However, neither support multiline PCRE matching.

I wanted to use this to detect files that don't end in a final newline, and pipe that into another command to remedy the situation.

Previously, my script only removed trailing whitespace and optionally replaced tabs with spaces, so git grep did the trick. The script is able to handle arbitrary filenames, and I'd like it to stay that way.

@PhilipHazel
Copy link
Collaborator

This should be straightforward to implement, and I will look into it once I have got some other work out of the way.

@PhilipHazel
Copy link
Collaborator

I have just committed a patch that implements -Z aka --null. It is intended to be much the same as GNU grep.

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

No branches or pull requests

2 participants