Skip to content
Myr

Update help message

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

authored by sharkdp · committed by sharkdp · parent 9db4722 · Browse files · 3 files+11 added−8 removed
This commit

State

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

Diff stats

3 files+11 added−8 removed

  • other:+11 added−8 removed

3 files+11 added−8 removed

modified:src/main.rs+7 added-4 removed
24 unmodified lines
25 colored: bool,26 max_depth: usize27}2829const MAX_DEPTH_DEFAULT : usize = 25;3031/// Print a search result to the console.32fn print_entry(entry: &DirEntry, path_rel: &Path, config: &FdOptions) {33 let path_str = match path_rel.to_str() {34 Some(p) => p,
70 unmodified lines
105 "search filenames only (default: full path)");106 opts.optflag("", "hidden",107 "search hidden files/directories (default: off)");108 opts.optflag("F", "follow", "follow symlinks (default: off)");107 opts.optflag("n", "no-color", "do not colorize output");108 opts.optopt("d", "max-depth", "maximum search depth", "DEPTH");109 opts.optflag("n", "no-color", "do not colorize output (default: on)");110 opts.optopt("d", "max-depth",111 "maximum search depth (default: 25)", "D");112113 let matches = match opts.parse(&args[1..]) {114 Ok(m) => m,115 Err(e) => error(e.description())116 };117118 if matches.opt_present("h") {116 let brief = "Usage: fd [PATTERN]";119 let brief = "Usage: fd [options] [PATTERN]";120 print!("{}", opts.usage(&brief));121 process::exit(1);122 }123
19 unmodified lines
143 follow_links: matches.opt_present("follow"),144 max_depth:145 matches.opt_str("max-depth")146 .and_then(|ds| usize::from_str_radix(&ds, 10).ok())144 .unwrap_or(25)147 .unwrap_or(MAX_DEPTH_DEFAULT)148 };149150 match RegexBuilder::new(pattern)151 .case_insensitive(!config.case_sensitive)
5 unmodified lines
modified:Cargo.lock+1 added-1 removed
1[root]2name = "fd"3version = "0.1.0"3version = "0.2.0"4dependencies = [5 "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",6 "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",7 "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
155 unmodified lines
modified:Cargo.toml+3 added-3 removed