diff --git a/CHANGELOG.md b/CHANGELOG.md index 539a06e95..f557fe85a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,8 @@ Bug fixes: Fix gitignore parsing bug where a trailing `\/` resulted in an error. * [BUG #2243](https://github.com/BurntSushi/ripgrep/issues/2243): Fix `--sort` flag for values other than `path`. +* [BUG #2337](https://github.com/BurntSushi/ripgrep/issues/2337): + Improve docs to mention that `--stats` is always implied by `--json`. * [BUG #2381](https://github.com/BurntSushi/ripgrep/issues/2381): Make `-p/--pretty` override flags like `--no-line-number`. * [BUG #2392](https://github.com/BurntSushi/ripgrep/issues/2392): diff --git a/crates/core/flags/defs.rs b/crates/core/flags/defs.rs index d4e3daf1e..dbb85779a 100644 --- a/crates/core/flags/defs.rs +++ b/crates/core/flags/defs.rs @@ -3392,7 +3392,8 @@ flags are used in concert with \flag{json}. .sp Other flags that control aspects of the standard output such as \flag{only-matching}, \flag{heading}, \flag{replace}, \flag{max-columns}, etc., -have no effect when \flag{json} is set. +have no effect when \flag{json} is set. However, enabling JSON output will +always implicitly and unconditionally enable \flag{stats}. .sp A more complete description of the JSON format used can be found here: \fIhttps://docs.rs/grep-printer/*/grep_printer/struct.JSON.html\fP. @@ -6420,6 +6421,8 @@ complete. .sp This set of aggregate statistics may expand over time. .sp +This flag is always and implicitly enabled when \flag{json} is used. +.sp Note that this flag has no effect if \flag{files}, \flag{files-with-matches} or \flag{files-without-match} is passed. "