mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
Update docs to explain use of -g and --files to search for paths. (#285)
Update docs to explain use of -g and --files to search for paths. Fixes #284
This commit is contained in:
parent
8396d3ffaa
commit
900ef0abc7
@ -268,6 +268,12 @@ Or exclude files matching a particular glob:
|
|||||||
$ rg foo -g '!*.min.js'
|
$ rg foo -g '!*.min.js'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Search and return paths matching a particular glob (i.e., `-g` flag in ag/ack):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ rg -g 'doc*' --files
|
||||||
|
```
|
||||||
|
|
||||||
Search only HTML and CSS files:
|
Search only HTML and CSS files:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
16
doc/rg.1
16
doc/rg.1
@ -1,6 +1,6 @@
|
|||||||
.\" Automatically generated by Pandoc 1.18
|
.\" Automatically generated by Pandoc 1.19.1
|
||||||
.\"
|
.\"
|
||||||
.TH "rg" "1"
|
.TH "" "" "" "" ""
|
||||||
.hy
|
.hy
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
@ -69,6 +69,14 @@ Multiple glob flags may be used.
|
|||||||
Globbing rules match .gitignore globs.
|
Globbing rules match .gitignore globs.
|
||||||
Precede a glob with a \[aq]!\[aq] to exclude it.
|
Precede a glob with a \[aq]!\[aq] to exclude it.
|
||||||
.RS
|
.RS
|
||||||
|
.PP
|
||||||
|
Values given to \-g must be quoted or your shell will expand them and
|
||||||
|
result in unexpected behavior.
|
||||||
|
.PP
|
||||||
|
Combine with the \-\-files flag to return matched filenames (i.e., to
|
||||||
|
replicate ack/ag\[aq]s \-g flag).
|
||||||
|
.PP
|
||||||
|
For example: rg \-g \[aq]<glob>\[aq] \-\-files
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-h, \-\-help
|
.B \-h, \-\-help
|
||||||
@ -202,6 +210,10 @@ counted as part of the pattern.
|
|||||||
.B \-\-files
|
.B \-\-files
|
||||||
Print each file that would be searched (but don\[aq]t search).
|
Print each file that would be searched (but don\[aq]t search).
|
||||||
.RS
|
.RS
|
||||||
|
.PP
|
||||||
|
Combine with the \-g flag to return matched paths, for example:
|
||||||
|
.PP
|
||||||
|
rg \-g \[aq]<glob>\[aq] \-\-files
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-l, \-\-files\-with\-matches
|
.B \-l, \-\-files\-with\-matches
|
||||||
|
12
doc/rg.1.md
12
doc/rg.1.md
@ -52,6 +52,14 @@ Project home page: https://github.com/BurntSushi/ripgrep
|
|||||||
overrides any other ignore logic. Multiple glob flags may be used. Globbing
|
overrides any other ignore logic. Multiple glob flags may be used. Globbing
|
||||||
rules match .gitignore globs. Precede a glob with a '!' to exclude it.
|
rules match .gitignore globs. Precede a glob with a '!' to exclude it.
|
||||||
|
|
||||||
|
Values given to -g must be quoted or your shell will expand them and result
|
||||||
|
in unexpected behavior.
|
||||||
|
|
||||||
|
Combine with the --files flag to return matched filenames
|
||||||
|
(i.e., to replicate ack/ag's -g flag).
|
||||||
|
|
||||||
|
For example: rg -g '\<glob\>' --files
|
||||||
|
|
||||||
-h, --help
|
-h, --help
|
||||||
: Show this usage message.
|
: Show this usage message.
|
||||||
|
|
||||||
@ -136,6 +144,10 @@ Project home page: https://github.com/BurntSushi/ripgrep
|
|||||||
--files
|
--files
|
||||||
: Print each file that would be searched (but don't search).
|
: Print each file that would be searched (but don't search).
|
||||||
|
|
||||||
|
Combine with the -g flag to return matched paths, for example:
|
||||||
|
|
||||||
|
rg -g '\<glob\>' --files
|
||||||
|
|
||||||
-l, --files-with-matches
|
-l, --files-with-matches
|
||||||
: Only show path of each file with matches.
|
: Only show path of each file with matches.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user