Code formating

This commit is contained in:
Pramod Bisht 2018-03-25 20:06:37 +05:30 committed by David Peter
parent 8ce127e443
commit 67f6fdf6a7
3 changed files with 14 additions and 3 deletions

View file

@ -83,7 +83,16 @@ pub fn build_app() -> App<'static, 'static> {
.number_of_values(1)
.takes_value(true)
.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),
)
.arg(

View file

@ -164,7 +164,7 @@ fn main() {
"x" | "executable" => {
file_types.executables_only = true;
file_types.files = true;
},
}
_ => unreachable!(),
}
}

View file

@ -202,7 +202,9 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) {
if (entry_type.is_file() && !file_types.files)
|| (entry_type.is_dir() && !file_types.directories)
|| (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;
} else if !(entry_type.is_file() || entry_type.is_dir()