From 6771626553934f16306e8409aee78f7a63e43738 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 22 Jul 2018 09:38:49 -0400 Subject: [PATCH] ripgrep: improve usage documentation This shows an example for reading stdin. Fixes #951 --- CHANGELOG.md | 2 ++ doc/rg.1.txt.tpl | 2 ++ src/app.rs | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4fafc5..ec60755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,8 @@ Bug fixes: * [BUG #948](https://github.com/BurntSushi/ripgrep/issues/948): ripgrep now uses an exit code of 2 to indicate an error, and uses an exit code of 1 to indicate that no matches were found. +* [BUG #951](https://github.com/BurntSushi/ripgrep/issues/951): + Add stdin example to ripgrep usage documentation. * [BUG #955](https://github.com/BurntSushi/ripgrep/issues/955): Use buffered writing when not printing to a tty, which fixes a performance regression. diff --git a/doc/rg.1.txt.tpl b/doc/rg.1.txt.tpl index fc268f8..ab1ef78 100644 --- a/doc/rg.1.txt.tpl +++ b/doc/rg.1.txt.tpl @@ -18,6 +18,8 @@ Synopsis *rg* [_OPTIONS_] *--type-list* +*command* | *rg* [_OPTIONS_] _PATTERN_ + *rg* [_OPTIONS_] *--help* *rg* [_OPTIONS_] *--version* diff --git a/src/app.rs b/src/app.rs index 4336d5a..402bef5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -33,7 +33,8 @@ const USAGE: &str = " rg [OPTIONS] PATTERN [PATH ...] rg [OPTIONS] [-e PATTERN ...] [-f PATTERNFILE ...] [PATH ...] rg [OPTIONS] --files [PATH ...] - rg [OPTIONS] --type-list"; + rg [OPTIONS] --type-list + command | rg [OPTIONS] PATTERN"; const TEMPLATE: &str = "\ {bin} {version}