mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-19 02:10:34 +01:00
Code formating
This commit is contained in:
parent
8ce127e443
commit
67f6fdf6a7
3 changed files with 14 additions and 3 deletions
11
src/app.rs
11
src/app.rs
|
@ -83,7 +83,16 @@ pub fn build_app() -> App<'static, 'static> {
|
||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("filetype")
|
.value_name("filetype")
|
||||||
.possible_values(&["f", "file", "d", "directory", "l", "symlink", "x", "executable"])
|
.possible_values(&[
|
||||||
|
"f",
|
||||||
|
"file",
|
||||||
|
"d",
|
||||||
|
"directory",
|
||||||
|
"l",
|
||||||
|
"symlink",
|
||||||
|
"x",
|
||||||
|
"executable",
|
||||||
|
])
|
||||||
.hide_possible_values(true),
|
.hide_possible_values(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -164,7 +164,7 @@ fn main() {
|
||||||
"x" | "executable" => {
|
"x" | "executable" => {
|
||||||
file_types.executables_only = true;
|
file_types.executables_only = true;
|
||||||
file_types.files = true;
|
file_types.files = true;
|
||||||
},
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,9 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) {
|
||||||
if (entry_type.is_file() && !file_types.files)
|
if (entry_type.is_file() && !file_types.files)
|
||||||
|| (entry_type.is_dir() && !file_types.directories)
|
|| (entry_type.is_dir() && !file_types.directories)
|
||||||
|| (entry_type.is_symlink() && !file_types.symlinks)
|
|| (entry_type.is_symlink() && !file_types.symlinks)
|
||||||
|| (entry.metadata().is_ok() && !output::is_executable(&entry.metadata().unwrap()) && file_types.executables_only)
|
|| (entry.metadata().is_ok()
|
||||||
|
&& !output::is_executable(&entry.metadata().unwrap())
|
||||||
|
&& file_types.executables_only)
|
||||||
{
|
{
|
||||||
return ignore::WalkState::Continue;
|
return ignore::WalkState::Continue;
|
||||||
} else if !(entry_type.is_file() || entry_type.is_dir()
|
} else if !(entry_type.is_file() || entry_type.is_dir()
|
||||||
|
|
Loading…
Reference in a new issue