summaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-03-15 10:28:59 -0400
committerAndrew Gallant <jamslam@gmail.com>2020-03-15 13:19:14 -0400
commit447506ebe02f1475734b66137feb02ae0fd9decf (patch)
tree4bf61f4230e89b934944f21699326dca85349091 /crates
parent12e41809850a4ac14ed200101ef8b033d2a20c38 (diff)
doc: clarify globing behavior
Fixes #1442, Fixes #1478
Diffstat (limited to 'crates')
-rw-r--r--crates/core/app.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/core/app.rs b/crates/core/app.rs
index 04bcf878..410cb0c1 100644
--- a/crates/core/app.rs
+++ b/crates/core/app.rs
@@ -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")