Skip to content

Commit 78eba7e

Browse files
authored
Merge pull request #136 from refi64/xdev
Add support for -xdev
2 parents d6433f9 + 0a8b72f commit 78eba7e

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/find/matchers/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ fn build_matcher_tree(
400400
config.depth_first = true;
401401
None
402402
}
403+
"-xdev" => {
404+
// TODO add warning if it appears after actual testing criterion
405+
config.same_file_system = true;
406+
None
407+
}
403408
"-sorted" => {
404409
// TODO add warning if it appears after actual testing criterion
405410
config.sorted_output = true;

src/find/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::time::SystemTime;
1414
use walkdir::WalkDir;
1515

1616
pub struct Config {
17+
same_file_system: bool,
1718
depth_first: bool,
1819
min_depth: usize,
1920
max_depth: usize,
@@ -25,6 +26,7 @@ pub struct Config {
2526
impl Default for Config {
2627
fn default() -> Config {
2728
Config {
29+
same_file_system: false,
2830
depth_first: false,
2931
min_depth: 0,
3032
max_depth: usize::max_value(),
@@ -115,7 +117,8 @@ fn process_dir<'a>(
115117
let mut walkdir = WalkDir::new(dir)
116118
.contents_first(config.depth_first)
117119
.max_depth(config.max_depth)
118-
.min_depth(config.min_depth);
120+
.min_depth(config.min_depth)
121+
.same_file_system(config.same_file_system);
119122
if config.sorted_output {
120123
walkdir = walkdir.sort_by(|a, b| a.file_name().cmp(b.file_name()));
121124
}
@@ -196,6 +199,7 @@ Early alpha implementation. Currently the only expressions supported are
196199
-maxdepth N
197200
-mindepth N
198201
-d[epth]
202+
-xdev
199203
-ctime [+-]N
200204
-atime [+-]N
201205
-mtime [+-]N

0 commit comments

Comments
 (0)