Skip to content
Myr

Search only filename by default, closes #22

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

authored by sharkdp · committed by sharkdp · parent f9cb332 · Browse files · 1 file+5 added−5 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−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:src/main.rs+5 added-5 removed
200 unmodified lines
201 let mut opts = Options::new();202 opts.optflag("h", "help", "print this help message");203 opts.optflag("s", "sensitive",204 "case-sensitive search (default: smart case)");205 opts.optflag("f", "filename",206 "search filenames only (default: full path)");205 opts.optflag("p", "full-path",206 "search full path (default: filename only)");207 opts.optflag("H", "hidden",208 "search hidden files/directories (default: off)");209 opts.optflag("F", "follow", "follow symlinks (default: off)");210 opts.optflag("n", "no-color", "do not colorize output (default: on)");211 opts.optopt("d", "max-depth",212 format!("maximum search depth (default: {})",211 opts.optopt( "d", "max-depth",212 format!("maximum search depth (default: {})",213 MAX_DEPTH_DEFAULT).as_str(),214 "D");215216 let matches = match opts.parse(&args[1..]) {
32 unmodified lines
249 // The search will be case-sensitive if the command line flag is set or250 // if the pattern has an uppercase character (smart case).251 case_sensitive: matches.opt_present("sensitive") ||252 pattern.chars().any(char::is_uppercase),253 search_full_path: !matches.opt_present("filename"),253 search_full_path: matches.opt_present("full-path"),254 search_hidden: matches.opt_present("hidden"),255 colored: colored_output,256 follow_links: matches.opt_present("follow"),257 max_depth:
13 unmodified lines