mirror of
https://github.com/jht5945/finding.git
synced 2025-12-29 06:00:04 +08:00
ref verbose
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -182,9 +182,7 @@ fn find_text_files(options: &Options, dir_path: &Path) {
|
||||
}
|
||||
let file_content = match read_file_content(p, options.parsed_large_text_file_size) {
|
||||
Ok(c) => c, Err(err) => {
|
||||
if options.verbose {
|
||||
clear_n_print_message(MessageType::WARN, &format!("Read file {} failed: {}", p_str, err));
|
||||
}
|
||||
if options.verbose { clear_n_print_message(MessageType::WARN, &format!("Read file {} failed: {}", p_str, err)); }
|
||||
return;
|
||||
},
|
||||
};
|
||||
@@ -196,27 +194,19 @@ fn find_text_files(options: &Options, dir_path: &Path) {
|
||||
total_dir_count_cell.replace_with(|&mut c| c + 1);
|
||||
if let Some(p_str) = p.to_str() {
|
||||
if (!options.scan_dot_git) && p_str.ends_with("/.git") {
|
||||
if options.verbose {
|
||||
clear_n_print_message(MessageType::INFO, &format!("Skip .git dir: {}", p_str));
|
||||
}
|
||||
if options.verbose { clear_n_print_message(MessageType::INFO, &format!("Skip .git dir: {}", p_str)); }
|
||||
return false;
|
||||
}
|
||||
if options.skip_target_dir && p_str.ends_with("/target") {
|
||||
if options.verbose {
|
||||
clear_n_print_message(MessageType::INFO, &format!("Skip target dir: {}", p_str));
|
||||
}
|
||||
if options.verbose { clear_n_print_message(MessageType::INFO, &format!("Skip target dir: {}", p_str)); }
|
||||
return false;
|
||||
}
|
||||
if options.skip_dot_dir && p_str.contains("/.") {
|
||||
if options.verbose {
|
||||
clear_n_print_message(MessageType::INFO, &format!("Skip dot(.) dir: {}", p_str));
|
||||
}
|
||||
if options.verbose { clear_n_print_message(MessageType::INFO, &format!("Skip dot(.) dir: {}", p_str)); }
|
||||
return false;
|
||||
}
|
||||
if options.skip_link_dir && is_symlink(p) {
|
||||
if options.verbose {
|
||||
clear_n_print_message(MessageType::INFO, &format!("Skip link dir: {}", p_str));
|
||||
}
|
||||
if options.verbose { clear_n_print_message(MessageType::INFO, &format!("Skip link dir: {}", p_str)); }
|
||||
return false;
|
||||
}
|
||||
scaned_dir_count_cell.replace_with(|&mut c| c + 1);
|
||||
|
||||
Reference in New Issue
Block a user