Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to explain use of -g and --files to search for paths. #285

Merged
merged 2 commits into from Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -268,6 +268,12 @@ Or exclude files matching a particular glob:
$ 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:

```
Expand Down
16 changes: 14 additions & 2 deletions 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
.SH NAME
.PP
Expand Down Expand Up @@ -69,6 +69,14 @@ Multiple glob flags may be used.
Globbing rules match .gitignore globs.
Precede a glob with a \[aq]!\[aq] to exclude it.
.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
.TP
.B \-h, \-\-help
Expand Down Expand Up @@ -202,6 +210,10 @@ counted as part of the pattern.
.B \-\-files
Print each file that would be searched (but don\[aq]t search).
.RS
.PP
Combine with the \-g flag to return matched paths, for example:
.PP
rg \-g \[aq]<glob>\[aq] \-\-files
.RE
.TP
.B \-l, \-\-files\-with\-matches
Expand Down
12 changes: 12 additions & 0 deletions doc/rg.1.md
Expand Up @@ -52,6 +52,14 @@ Project home page: https://github.com/BurntSushi/ripgrep
overrides any other ignore logic. Multiple glob flags may be used. Globbing
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
: Show this usage message.

Expand Down Expand Up @@ -136,6 +144,10 @@ Project home page: https://github.com/BurntSushi/ripgrep
--files
: 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
: Only show path of each file with matches.

Expand Down