Repository: sharkdp/fd (language: rust)

Issue:
Combining fd and rg
fd 8.2.1 on Windows 10

`fd --changed-within "2021-10-09" | rg -i xxx`
won't return an result.

`fd --changed-within "2021-10-09" --exec  rg -i xxx`
returns the lines macthing xxx but the output is missing the filename where xxx is found.
Any idea how to get the filename where xxx is found?

`rg -i xxx` 
alone returns machting lines including filename



Discussion / hints:
If you use `fd`s `-x` option, it will call `rg` once for each search result. `rg` is thus called with a single file argument and does not see the need to show you the filename (although you can force it to, using `rg`s `-H`/`--with-filename` option).

What I suggest doing (and often do myself) is to use `fd`s capital `-X` option which calls `rg` *once*, with all search results as arguments. This way, it should show you the filenames by default:
```
fd --changed-within "2021-10-09" -X rg -i xxx
```

Please let us know if that worked for you and how we could improve the documentation for future users.
Just works for me! Thank you very much. 
Please keep your great work :)
You're welcome. Thank you for the feedback.

Do you think that the documentation could be improved?
Imho an example for the `-X` parameter with `rg ` and your explanation would be useful.
I can take care of updating the documentation.

Fix patch:
diff --git a/README.md b/README.md
index e0fc261e4..4253b3c73 100644
--- a/README.md
+++ b/README.md
@@ -194,6 +194,11 @@ fd … -X ls -lhd --color=always
 This pattern is so useful that `fd` provides a shortcut. You can use the `-l`/`--list-details`
 option to execute `ls` in this way: `fd … -l`.
 
+The `-X` option is also useful when combining `fd` with [ripgrep](https://github.com/BurntSushi/ripgrep/) (`rg`) in order to search within a certain class of files, like all C++ source files:
+```bash
+fd -e cpp -e cxx -e h -e hpp -X rg 'std::cout'
+```
+
 Convert all `*.jpg` files to `*.png` files:
 ``` bash
 fd -e jpg -x convert {} {.}.png


Test patch: