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