Skip to content

Commit

Permalink
doc: clarify globing behavior
Browse files Browse the repository at this point in the history
Fixes #1442, Fixes #1478
  • Loading branch information
BurntSushi committed Mar 15, 2020
1 parent 12e4180 commit 447506e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Bug fixes:
Improve documentation for ripgrep's automatic stdin detection.
* [BUG #1441](https://github.com/BurntSushi/ripgrep/issues/1441):
Remove CPU features from man page.
* [BUG #1442](https://github.com/BurntSushi/ripgrep/issues/1442),
[BUG #1478](https://github.com/BurntSushi/ripgrep/issues/1478):
Improve documentation of the `-g/--glob` flag.
* [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):
Expand Down
8 changes: 7 additions & 1 deletion crates/core/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,13 @@ fn flag_glob(args: &mut Vec<RGArg>) {
Include or exclude files and directories for searching that match the given
glob. This always overrides any other ignore logic. Multiple glob flags may be
used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude
it.
it. If multiple globs match a file or directory, the glob given later in the
command line takes precedence.
When this flag is set, every file and directory is applied to it to test for
a match. So for example, if you only want to search in a particular directory
'foo', then *-g foo* is incorrect because 'foo/bar' does not match the glob
'foo'. Instead, you should use *-g +++'foo/**'+++*.
"
);
let arg = RGArg::flag("glob", "GLOB")
Expand Down

0 comments on commit 447506e

Please sign in to comment.