mirror of https://github.com/sharkdp/fd.git
Search only filename by default, closes #22
This commit is contained in:
parent
f9cb3326c8
commit
c45cf26577
10
src/main.rs
10
src/main.rs
|
@ -202,14 +202,14 @@ fn main() {
|
||||||
opts.optflag("h", "help", "print this help message");
|
opts.optflag("h", "help", "print this help message");
|
||||||
opts.optflag("s", "sensitive",
|
opts.optflag("s", "sensitive",
|
||||||
"case-sensitive search (default: smart case)");
|
"case-sensitive search (default: smart case)");
|
||||||
opts.optflag("f", "filename",
|
opts.optflag("p", "full-path",
|
||||||
"search filenames only (default: full path)");
|
"search full path (default: filename only)");
|
||||||
opts.optflag("H", "hidden",
|
opts.optflag("H", "hidden",
|
||||||
"search hidden files/directories (default: off)");
|
"search hidden files/directories (default: off)");
|
||||||
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",
|
||||||
format!("maximum search depth (default: {})",
|
format!("maximum search depth (default: {})",
|
||||||
MAX_DEPTH_DEFAULT).as_str(),
|
MAX_DEPTH_DEFAULT).as_str(),
|
||||||
"D");
|
"D");
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ fn main() {
|
||||||
// if the pattern has an uppercase character (smart case).
|
// if the pattern has an uppercase character (smart case).
|
||||||
case_sensitive: matches.opt_present("sensitive") ||
|
case_sensitive: matches.opt_present("sensitive") ||
|
||||||
pattern.chars().any(char::is_uppercase),
|
pattern.chars().any(char::is_uppercase),
|
||||||
search_full_path: !matches.opt_present("filename"),
|
search_full_path: matches.opt_present("full-path"),
|
||||||
search_hidden: matches.opt_present("hidden"),
|
search_hidden: matches.opt_present("hidden"),
|
||||||
colored: colored_output,
|
colored: colored_output,
|
||||||
follow_links: matches.opt_present("follow"),
|
follow_links: matches.opt_present("follow"),
|
||||||
|
|
Loading…
Reference in New Issue