You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The general approach of configuration and command line options seems to be that if two options conflict, the later one prevails and the earlier one is treated as if it were never given. For example, the "--binary" option will cancel out the "--no-binary" option if it appears later in the configuration file or later on the command line. Similarly, "--text" will override the "--binary" option if it appears later in the configuration file or command line, and vice versa. However, the context output options (-A, -B, and -C) do not similarly override and get overridden by the "--passthru" option. It seems as if they should override each other.
I encountered this when spitting out a bunch of JSON that I wanted to filter through ripgrep. I put together my command line to output the JSON, then piped it to rg with "--passthru" and my pattern. It worked as expected. Then I up-arrowed to get the same command line but added a "-C" to it. I didn't even think about the fact that I hadn't removed the previous "--passthru". I just thought, conceptually, that I was further refining the command line to filter down the results a little more. It confused me when I still got aaalllll of the JSON.
It seems as if the context output options (-A, -B, and -C) should override the "--passthru" option, and vice versa, when given later in the configuration file or command line.
The text was updated successfully, but these errors were encountered:
What version of ripgrep are you using?
ripgrep 12.1.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
dnf install ripgrep
What operating system are you using ripgrep on?
GNU/Linux 5.11.18-300.fc34.x86_64 x86_64
Describe your bug.
The general approach of configuration and command line options seems to be that if two options conflict, the later one prevails and the earlier one is treated as if it were never given. For example, the "--binary" option will cancel out the "--no-binary" option if it appears later in the configuration file or later on the command line. Similarly, "--text" will override the "--binary" option if it appears later in the configuration file or command line, and vice versa. However, the context output options (-A, -B, and -C) do not similarly override and get overridden by the "--passthru" option. It seems as if they should override each other.
I encountered this when spitting out a bunch of JSON that I wanted to filter through ripgrep. I put together my command line to output the JSON, then piped it to rg with "--passthru" and my pattern. It worked as expected. Then I up-arrowed to get the same command line but added a "-C" to it. I didn't even think about the fact that I hadn't removed the previous "--passthru". I just thought, conceptually, that I was further refining the command line to filter down the results a little more. It confused me when I still got aaalllll of the JSON.
What are the steps to reproduce the behavior?
What is the expected behavior?
It seems as if the context output options (-A, -B, and -C) should override the "--passthru" option, and vice versa, when given later in the configuration file or command line.
The text was updated successfully, but these errors were encountered: