Skip to content

Commit 6771626

Browse files
committed
ripgrep: improve usage documentation
This shows an example for reading stdin. Fixes #951
1 parent b9c922b commit 6771626

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ Bug fixes:
8484
* [BUG #948](https://github.com/BurntSushi/ripgrep/issues/948):
8585
ripgrep now uses an exit code of 2 to indicate an error, and uses an exit
8686
code of 1 to indicate that no matches were found.
87+
* [BUG #951](https://github.com/BurntSushi/ripgrep/issues/951):
88+
Add stdin example to ripgrep usage documentation.
8789
* [BUG #955](https://github.com/BurntSushi/ripgrep/issues/955):
8890
Use buffered writing when not printing to a tty, which fixes a performance
8991
regression.

doc/rg.1.txt.tpl

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Synopsis
1818

1919
*rg* [_OPTIONS_] *--type-list*
2020

21+
*command* | *rg* [_OPTIONS_] _PATTERN_
22+
2123
*rg* [_OPTIONS_] *--help*
2224

2325
*rg* [_OPTIONS_] *--version*

src/app.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const USAGE: &str = "
3333
rg [OPTIONS] PATTERN [PATH ...]
3434
rg [OPTIONS] [-e PATTERN ...] [-f PATTERNFILE ...] [PATH ...]
3535
rg [OPTIONS] --files [PATH ...]
36-
rg [OPTIONS] --type-list";
36+
rg [OPTIONS] --type-list
37+
command | rg [OPTIONS] PATTERN";
3738

3839
const TEMPLATE: &str = "\
3940
{bin} {version}

0 commit comments

Comments
 (0)