Repository: phiresky/ripgrep-all (language: rust)

Issue:
Searching `.snagx` file extension
I'd like to be able to search over `.snagx` (zip) files to find certain metadata in them.

Me attempting without luck.
```
 $ rga "Version"
test.json.zip
test.json:   "Version": "1"

 $ rga "Version" 2024-06-19_19-58-35.snagx
binary file matches (found "\0" byte around offset 5)
```

anatomy of a `.snagx` file:
```
 $ file 2024-06-19_19-58-35.snagx
2024-06-19_19-58-35.snagx: Zip archive data, at least v2.0 to extract, compression method=store
```

What the achive looks like.
```
├── index.json
├── metadata.json
├── thumbnail.png
├── {5839C95A-137D-4262-87C1-32DEB7C43D30}.backup.json
├── {5839C95A-137D-4262-87C1-32DEB7C43D30}.json
└── {5839C95A-137D-4262-87C1-32DEB7C43D30}.png
```

Seems `.zip` file extension is looked for explicitly but wondering is there a workaround without me having to rename the file extension?
```
 $ rga "Version"
2024-06-19_19-58-35.zip
index.json:   "Version" : "1.0"
{5839C95A-137D-4262-87C1-32DEB7C43D30}.json:   "SoftwareVersion" : "2024.2.5",
{5839C95A-137D-4262-87C1-32DEB7C43D30}.json:   "Version" : "1.0"
{5839C95A-137D-4262-87C1-32DEB7C43D30}.backup.json:   "SoftwareVersion" : "2024.2.5",
{5839C95A-137D-4262-87C1-32DEB7C43D30}.backup.json:   "Version" : "1.0"
metadata.json:   "AppVersion" : "0.1.0 (1)",
metadata.json:   "OperatingSystemVersion" : "macOS 14.5.0",
metadata.json:   "Version" : "1.0",
```


Discussion / hints:
> Seems `.zip` file extension is looked for explicitly but wondering is there a workaround without me having to rename the file extension?

Renaming the file is currently the only workaround.

The extensions that are treated as Zip archives is currently [hardcoded](https://github.com/phiresky/ripgrep-all/blob/master/src/adapters/zip.rs#L8). There have been some recent PRs (e.g. #208, #213) adding additional extensions. The author has [indicated](https://github.com/phiresky/ripgrep-all/pull/208#issuecomment-2173241243) that they would accept a PR making this list user-configurable.

Fix patch:
diff --git a/src/adapters/zip.rs b/src/adapters/zip.rs
index 5432ffd..8c30407 100644
--- a/src/adapters/zip.rs
+++ b/src/adapters/zip.rs
@@ -5,7 +5,9 @@ use async_stream::stream;
 use lazy_static::lazy_static;
 use log::*;
 
-static EXTENSIONS: &[&str] = &["zip", "jar", "xpi", "kra"];
+// TODO: allow users to configure file extensions instead of hard coding the list
+// https://github.com/phiresky/ripgrep-all/pull/208#issuecomment-2173241243
+static EXTENSIONS: &[&str] = &["zip", "jar", "xpi", "kra", "snagx"];
 
 lazy_static! {
     static ref METADATA: AdapterMeta = AdapterMeta {


Test patch: