diff options
author | Andrew Gallant <jamslam@gmail.com> | 2023-11-24 14:04:40 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2023-11-25 15:03:53 -0500 |
commit | 1cbcefddc9cfe1a9acbcc71adef7d9c0591fcb1d (patch) | |
tree | 699878c6ad71694226756c380b2c272460cd9e24 /crates | |
parent | 4fec9ffca82fb02824d889876c802b1ec54bf403 (diff) |
doc: add more warnings about --vimgrep
The --vimgrep flag has some severe footguns when using a pattern that
matches very frequently. We had already written some docs to warn about
that, but now we also include a suggestion to avoid exorbitant heap
usage.
Closes #2505
Diffstat (limited to 'crates')
-rw-r--r-- | crates/core/flags/defs.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/core/flags/defs.rs b/crates/core/flags/defs.rs index cd7cdd32..d4e3daf1 100644 --- a/crates/core/flags/defs.rs +++ b/crates/core/flags/defs.rs @@ -7242,6 +7242,10 @@ if the pattern matches every byte in an input file, then each line will be repeated for every byte matched. For this reason, users should only use this flag when there is no other choice. Editor integrations should prefer some other way of reading results from ripgrep, such as via the \flag{json} flag. +One alternative to avoiding exorbitant memory usage is to force ripgrep into +single threaded mode with the \flag{threads} flag. Note though that this will +not impact the total size of the output, just the heap memory that ripgrep will +use. " } fn doc_choices(&self) -> &'static [&'static str] { |