Skip to content

-A/-B completely overrides -C #2288

@jwilk

Description

@jwilk

What version of ripgrep are you using?

ripgrep 13.0.0
-SIMD -AVX (compiled)

How did you install ripgrep?

apt-get install ripgrep

What operating system are you using ripgrep on?

Debian unstable

Describe your bug.

The -A option completely overrides -C:

$ seq 1 10 | rg 5 -C1 -A2
5
6
7

What is the expected behavior?

The -A option should affect only trailing context.
This is how it works in GNU grep:

$ seq 1 10 | grep 5 -C1 -A2
4
5
6
7

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn enhancement to the functionality of the software.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions