Skip to content

Having grep support the -o option like GNU grep et al #232

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

Closed
dscho opened this issue May 29, 2019 · 2 comments
Closed

Having grep support the -o option like GNU grep et al #232

dscho opened this issue May 29, 2019 · 2 comments
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits

Comments

@dscho
Copy link
Member

dscho commented May 29, 2019

We have most of the code for this already in the form of our color hi-lighting, it would mostly just be a matter of "just print out the stuff you'd have colored", with the small exception that if you have more than one match on a line they should be printed out on their own lines.

Copied from: https://public-inbox.org/git/[email protected]/

@dscho dscho added the leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits label May 29, 2019
@bbolli
Copy link

bbolli commented May 29, 2019

I think this was already implemented in 9d8db06 ("grep.c: teach 'git grep --only-matching'", 2018-07-09).

@dscho
Copy link
Member Author

dscho commented May 30, 2019

@bbolli indeed! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
leftoverbits From the Git mailing list: https://lore.kernel.org/git/?q=%23leftoverbits
Projects
None yet
Development

No branches or pull requests

2 participants