$ rg --version
ripgrep 0.8.1
-SIMD -AVX
$ macosver
ProductBuildVersion 17C2120
ProductCopyright 1983-2017 Apple Inc.
ProductName Mac OS X
ProductUserVisibleVersion 10.13.2
ProductVersion 10.13.2
$ echo test > test
$ zip test.zip test
adding: test (stored 0%)
$ tar zcvf test.tar.gz test
a test
$ gzip test
$ rg -z test
./test.gz
1:test
$ rg -zl test
test.gz
No .zip or .tar.gz are searched.
Should search in .zip and .tar.gz files.
The documentation states:
Search in compressed files. Currently gz, bz2, xz, and lzma files are
supported. This option expects the decompression binaries to be available in
your PATH.
So this is expected behavior. ripgrep does not advertise support for searching through tar archives.
I thought --search-zip arg is self-explanatory. And also thought .tar.gz is included as part of .gz.
And at the end, .tar is just plain binary file, so this works:
$ rg -a test test.tar.gz
1?(?Ztest.tar??A
but this not:
$ rg -z -a test test.tar.gz
So if this is as expected, can we keep it open as part of the feature request?
That's because tar archives are explicitly skipped:
I admit, it does seem like rg -z -a test test.tar.gz should work.