From daa831939873a50cd7e193a7211b5e3d37ad631c Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 15 Mar 2020 09:55:31 -0400 Subject: [PATCH] doc: note ripgrep's stdin behavior Fixes #1439 --- CHANGELOG.md | 2 ++ crates/core/app.rs | 5 +++++ doc/rg.1.txt.tpl | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8454b46c..d7ab5739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ Bug fixes: Document usage of `--type all`. * [BUG #1389](https://github.com/BurntSushi/ripgrep/issues/1389): Fixes a bug where ripgrep would panic when searching a symlinked directory. +* [BUG #1439](https://github.com/BurntSushi/ripgrep/issues/1439): + Improve documentation for ripgrep's automatic stdin detection. * [BUG #1445](https://github.com/BurntSushi/ripgrep/issues/1445): ripgrep now respects ignore rules from .git/info/exclude in worktrees. * [BUG #1485](https://github.com/BurntSushi/ripgrep/issues/1485): diff --git a/crates/core/app.rs b/crates/core/app.rs index d65b41fa..ef9cf883 100644 --- a/crates/core/app.rs +++ b/crates/core/app.rs @@ -27,6 +27,11 @@ configuration file. The file can specify one shell argument per line. Lines starting with '#' are ignored. For more details, see the man page or the README. +ripgrep will automatically detect if stdin exists and search stdin for a regex +pattern, e.g. 'ls | rg foo'. In some environments, stdin may exist when it +shouldn't. To turn off stdin detection explicitly specify the directory to +search, e.g. 'rg foo ./'. + Tip: to disable all smart filtering and make ripgrep behave a bit more like classical grep, use 'rg -uuu'. diff --git a/doc/rg.1.txt.tpl b/doc/rg.1.txt.tpl index 2d3a391f..2ba38dca 100644 --- a/doc/rg.1.txt.tpl +++ b/doc/rg.1.txt.tpl @@ -41,6 +41,11 @@ configuration file. The file can specify one shell argument per line. Lines starting with *#* are ignored. For more details, see the man page or the *README*. +ripgrep will automatically detect if stdin exists and search stdin for a regex +pattern, e.g. *ls | rg foo*. In some environments, stdin may exist when it +shouldn't. To turn off stdin detection explicitly specify the directory to +search, e.g. *rg foo ./*. + Tip: to disable all smart filtering and make ripgrep behave a bit more like classical grep, use *rg -uuu*.