Skip to content

should ripgrep use : instead of - for separating file paths from matches when --no-heading is used? #2423

Answered by BurntSushi
rieje asked this question in General
Discussion options

You must be logged in to vote

Why not show an example? :-) For example, it seems like an implicit assumption in your question it that ripgrep uses - as a delimiter to separate file paths and the matching string, but it actually uses :, just like grep:

$ rg 'fn line_buffer' --no-heading
crates/searcher/src/searcher/mod.rs:207:    fn line_buffer(&self) -> LineBuffer {

Of course, if you add contextual options, then contextual lines use -, just like grep:

$ rg 'fn line_buffer' --no-heading -C2
crates/searcher/src/searcher/mod.rs-205-
crates/searcher/src/searcher/mod.rs-206-    /// Build a line buffer from this configuration.
crates/searcher/src/searcher/mod.rs:207:    fn line_buffer(&self) -> LineBuffer {
crates/searcher…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@BurntSushi
Comment options

@rieje
Comment options

Answer selected by rieje
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants