diff options
author | Robert Irelan <rirelan@gmail.com> | 2020-01-27 10:52:32 -0800 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-02-17 17:16:28 -0500 |
commit | 24f8a3e5ec4729c8e485547ca40157920ae64b9c (patch) | |
tree | ece4b9f2559c3b8d97f3bd5776fedeb602f56f8b /GUIDE.md | |
parent | 1bdb767851d10acc9bf5b9306b7cc62cadbfe121 (diff) |
doc: document `all` file type
This adds it to the guide and the docs for the --type flag.
Fixes #1344, Closes #1472
Diffstat (limited to 'GUIDE.md')
-rw-r--r-- | GUIDE.md | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -411,6 +411,21 @@ alias rg="rg --type-add 'web:*.{html,css,js}'" or add `--type-add=web:*.{html,css,js}` to your ripgrep configuration file. ([Configuration files](#configuration-file) are covered in more detail later.) +#### The special `all` file type + +A special option supported by the `--type` flag is `all`. `--type all` looks +for a match in any of the supported file types listed by `--type-list`, +including those added on the command line using `--type-add`. It's equivalent +to the command `rg --type agda --type asciidoc --type asm ...`, where `...` +stands for a list of `--type` flags for the rest of the types in `--type-list`. + +As an example, let's suppose you have a shell script in your current directory, +`my-shell-script`, which includes a shell library, `my-shell-library.bash`. +Both `rg --type sh` and `rg --type all` would only search for matches in +`my-shell-library.bash`, not `my-shell-script`, because the globs matched +by the `sh` file type don't include files without an extension. On the +other hand, `rg --type-not all` would search `my-shell-script` but not +`my-shell-library.bash`. ### Replacements |