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 support for --passthr{u,ough} flag #740

Closed
zx8 opened this issue Jan 9, 2018 · 5 comments
Closed

Add support for --passthr{u,ough} flag #740

zx8 opened this issue Jan 9, 2018 · 5 comments
Labels
enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue.

Comments

@zx8
Copy link

zx8 commented Jan 9, 2018

After reading this comment on HN, I thought it'd be neat to add support for the --passthrough / --passthru flag in ripgrep as well.

Thoughts?

@okdana
Copy link
Contributor

okdana commented Jan 9, 2018

I was thinking about that myself. I personally think it's easier to do it the way i mentioned in that thread, but it seems like some people are quite passionate about it, and it would be very trivial to add a flag that wraps the pattern in ^|(?:...), the way we do with -w and -x. (At least, that's the method that first comes to mind, because it's easy and i have experience with it.)

@BurntSushi
Copy link
Owner

BurntSushi commented Jan 9, 2018

I'm kind of meh on it, but I don't feel strongly enough to reject it outright.

ag spells it --passthrough while ack spells it --passthru. How should ripgrep spell it? o_0 I suppose we could just accept both.

I like @okdana's suggested implementation.

@BurntSushi BurntSushi added enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue. labels Jan 9, 2018
@okdana
Copy link
Contributor

okdana commented Jan 9, 2018

If it were me i think i'd make it --passthru, with --passthrough as like a hidden alias. Can't recall if Clap supports that tho

@kbknapp
Copy link
Contributor

kbknapp commented Jan 9, 2018

Can't recall if Clap supports that tho

It does 😉 (You can also make it visible so it's findable in the help output)

okdana added a commit to okdana/ripgrep that referenced this issue Jan 11, 2018
BurntSushi pushed a commit that referenced this issue Jan 11, 2018
The --passthru flag causes ripgrep to print every line,
even if the line does not contain a match. This is a
response to the common pattern of `^|foo` to match every
line, while still highlighting things like `foo`.

Fixes #740
@BurntSushi
Copy link
Owner

@jzinn both are supported. Ripgrep has no specific goal to be "formal."

Please drop this. It's a waste of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the functionality of the software. help wanted Others are encouraged to work on this issue.
Projects
None yet
Development

No branches or pull requests

4 participants