summaryrefslogtreecommitdiffstats
path: root/crates/core/args.rs
diff options
context:
space:
mode:
authorgoto-engineering <goto@gotoengineering.io>2020-12-14 23:59:55 -0800
committerAndrew Gallant <jamslam@gmail.com>2021-05-31 21:51:18 -0400
commite6cac8b119d0d50646b3ba1aaf53e648c779901a (patch)
tree0b878c8574bdca3eb94585654c982c323e4e452e /crates/core/args.rs
parent0f502a9439822df41b3140d944f5d03c36144ecd (diff)
cli: print warning if nothing was searched
This was once part of ripgrep, but at some point, was unintentionally removed. The value of this warning is that since ripgrep tries to be "smart" by default, it can be surprising if it doesn't search certain things. This warning covers the case when ripgrep searches *nothing*, which happens somewhat more frequently than you might expect. e.g., If you're searching within an ignore directory. Note that for now, we only print this message when the user has not supplied any explicit paths. It's not clear that we want to print this otherwise, and in particular, it seems that the message shows up too eagerly. e.g., 'rg foo does-not-exist' will both print an error about 'does-not-exist' not existing, *and* the message about no files being searched, which seems annoying in this case. We can always refine this logic later. Fixes #1404, Closes #1762
Diffstat (limited to 'crates/core/args.rs')
-rw-r--r--crates/core/args.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/core/args.rs b/crates/core/args.rs
index 9c490e4e..7a448362 100644
--- a/crates/core/args.rs
+++ b/crates/core/args.rs
@@ -186,7 +186,7 @@ impl Args {
/// Returns true if and only if `paths` had to be populated with a default
/// path, which occurs only when no paths were given as command line
/// arguments.
- fn using_default_path(&self) -> bool {
+ pub fn using_default_path(&self) -> bool {
self.0.using_default_path
}