Skip to content
Myr

Document recursion depth

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent 750e1ed · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:src/main.rs+5 added-1 removed
15 unmodified lines
16use isatty::stdout_isatty;17use regex::{Regex, RegexBuilder};18use walkdir::{WalkDir, DirEntry, WalkDirIterator};1920/// Configuration options for *fd*.21struct FdOptions {22 case_sensitive: bool,23 search_full_path: bool,24 search_hidden: bool,
1 unmodified line
26 colored: bool,27 max_depth: usize28}2930/// The default maximum recursion depth.31const MAX_DEPTH_DEFAULT : usize = 25;3233/// Print a search result to the console.34fn print_entry(entry: &DirEntry, path_rel: &Path, config: &FdOptions) {
74 unmodified lines
109 "search hidden files/directories (default: off)");110 opts.optflag("F", "follow", "follow symlinks (default: off)");111 opts.optflag("n", "no-color", "do not colorize output (default: on)");112 opts.optopt("d", "max-depth",111 "maximum search depth (default: 25)", "D");113 format!("maximum search depth (default: {})",114 MAX_DEPTH_DEFAULT).as_str(),115 "D");116117 let matches = match opts.parse(&args[1..]) {118 Ok(m) => m,119 Err(e) => error(e.description())
41 unmodified lines