mirror of https://github.com/sharkdp/fd.git
Document recursion depth
This commit is contained in:
parent
750e1ed962
commit
5bde3513e6
|
@ -17,6 +17,7 @@ use isatty::stdout_isatty;
|
||||||
use regex::{Regex, RegexBuilder};
|
use regex::{Regex, RegexBuilder};
|
||||||
use walkdir::{WalkDir, DirEntry, WalkDirIterator};
|
use walkdir::{WalkDir, DirEntry, WalkDirIterator};
|
||||||
|
|
||||||
|
/// Configuration options for *fd*.
|
||||||
struct FdOptions {
|
struct FdOptions {
|
||||||
case_sensitive: bool,
|
case_sensitive: bool,
|
||||||
search_full_path: bool,
|
search_full_path: bool,
|
||||||
|
@ -26,6 +27,7 @@ struct FdOptions {
|
||||||
max_depth: usize
|
max_depth: usize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The default maximum recursion depth.
|
||||||
const MAX_DEPTH_DEFAULT : usize = 25;
|
const MAX_DEPTH_DEFAULT : usize = 25;
|
||||||
|
|
||||||
/// Print a search result to the console.
|
/// Print a search result to the console.
|
||||||
|
@ -108,7 +110,9 @@ fn main() {
|
||||||
opts.optflag("F", "follow", "follow symlinks (default: off)");
|
opts.optflag("F", "follow", "follow symlinks (default: off)");
|
||||||
opts.optflag("n", "no-color", "do not colorize output (default: on)");
|
opts.optflag("n", "no-color", "do not colorize output (default: on)");
|
||||||
opts.optopt("d", "max-depth",
|
opts.optopt("d", "max-depth",
|
||||||
"maximum search depth (default: 25)", "D");
|
format!("maximum search depth (default: {})",
|
||||||
|
MAX_DEPTH_DEFAULT).as_str(),
|
||||||
|
"D");
|
||||||
|
|
||||||
let matches = match opts.parse(&args[1..]) {
|
let matches = match opts.parse(&args[1..]) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
|
|
Loading…
Reference in New Issue