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
Provenance
- Commit
9aa4f0a- Tree
c282468- Author
sharkdp <davidpeter@web.de>- Committer
sharkdp <davidpeter@web.de>- Parent
9db4722
3 files changed+11 added−8 removed
modified:src/main.rs+7 added-4 removed
24 unmodified lines25 colored: bool,26 max_depth: usize27 }28 29+const MAX_DEPTH_DEFAULT : usize = 25;30+31 /// Print a search result to the console.32 fn print_entry(entry: &DirEntry, path_rel: &Path, config: &FdOptions) {33 let path_str = match path_rel.to_str() {34 Some(p) => p,70 unmodified lines105 "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");112 113 let matches = match opts.parse(&args[1..]) {114 Ok(m) => m,115 Err(e) => error(e.description())116 };117 118 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 lines143 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 };149 150 match RegexBuilder::new(pattern)151 .case_insensitive(!config.case_sensitive)5 unmodified linesmodified:Cargo.lock+1 added-1 removed
1 [root]2 name = "fd"3-version = "0.1.0"3+version = "0.2.0"4 dependencies = [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 linesmodified:Cargo.toml+3 added-3 removed
123345678910111011[package]name = "fd"version = "0.1.0"version = "0.2.0"authors = ["David Peter <mail@david-peter.de>"]
[dependencies]ansi_term = "0.9"getopts = "0.2"isatty = "0.1"regex = "0.2"walkdir = "1"ansi_term = "0.9"isatty = "0.1"