Fixes some typos
This commit is contained in:
parent
f00219d6d0
commit
1a87a69116
|
@ -9,10 +9,10 @@ pub enum Commands {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
directories: Directories,
|
directories: Directories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_directories: ExludedDirectories,
|
excluded_directories: ExcludedDirectories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_items: ExludedItems,
|
excluded_items: ExcludedItems,
|
||||||
#[structopt(short, long, parse(try_from_str = parse_min_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
#[structopt(short, long, parse(try_from_str = parse_minimal_file_size), default_value = "1024", help = "Minimum size in bytes", long_help = "Minimum size of checked files in bytes, assigning bigger value may speed up searching")]
|
||||||
min_size: u64,
|
min_size: u64,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
allowed_extensions: AllowedExtensions,
|
allowed_extensions: AllowedExtensions,
|
||||||
|
@ -25,7 +25,7 @@ pub enum Commands {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
not_recursive: NotRecursive,
|
not_recursive: NotRecursive,
|
||||||
},
|
},
|
||||||
#[structopt(name = "empty-folders", about = "Finds emtpty folders", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka empty-folders -d /home/rafal/rr /home/gateway -f results.txt")]
|
#[structopt(name = "empty-folders", about = "Finds empty folders", help_message = HELP_MESSAGE, after_help = "EXAMPLE:\n czkawka empty-folders -d /home/rafal/rr /home/gateway -f results.txt")]
|
||||||
EmptyFolders {
|
EmptyFolders {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
directories: Directories,
|
directories: Directories,
|
||||||
|
@ -39,9 +39,9 @@ pub enum Commands {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
directories: Directories,
|
directories: Directories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_directories: ExludedDirectories,
|
excluded_directories: ExcludedDirectories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_items: ExludedItems,
|
excluded_items: ExcludedItems,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
allowed_extensions: AllowedExtensions,
|
allowed_extensions: AllowedExtensions,
|
||||||
#[structopt(short, long, default_value = "50", help = "Number of files to be shown")]
|
#[structopt(short, long, default_value = "50", help = "Number of files to be shown")]
|
||||||
|
@ -56,9 +56,9 @@ pub enum Commands {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
directories: Directories,
|
directories: Directories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_directories: ExludedDirectories,
|
excluded_directories: ExcludedDirectories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_items: ExludedItems,
|
excluded_items: ExcludedItems,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
allowed_extensions: AllowedExtensions,
|
allowed_extensions: AllowedExtensions,
|
||||||
#[structopt(short = "D", long, help = "Delete found files")]
|
#[structopt(short = "D", long, help = "Delete found files")]
|
||||||
|
@ -73,9 +73,9 @@ pub enum Commands {
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
directories: Directories,
|
directories: Directories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_directories: ExludedDirectories,
|
excluded_directories: ExcludedDirectories,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
excluded_items: ExludedItems,
|
excluded_items: ExcludedItems,
|
||||||
#[structopt(short = "D", long, help = "Delete found files")]
|
#[structopt(short = "D", long, help = "Delete found files")]
|
||||||
delete_files: bool,
|
delete_files: bool,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
|
@ -92,14 +92,14 @@ pub struct Directories {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
pub struct ExludedDirectories {
|
pub struct ExcludedDirectories {
|
||||||
#[structopt(short, long, parse(from_os_str), help = "Exluded directorie(s)", long_help = "List of directorie(s) which will be excluded from search(absolute path)")]
|
#[structopt(short, long, parse(from_os_str), help = "Excluded directorie(s)", long_help = "List of directorie(s) which will be excluded from search(absolute path)")]
|
||||||
pub excluded_directories: Vec<PathBuf>,
|
pub excluded_directories: Vec<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
pub struct ExludedItems {
|
pub struct ExcludedItems {
|
||||||
#[structopt(short = "E", long, parse(from_os_str), help = "Exluded item(s)", long_help = "List of excluded item(s) which contains * wildcard(may be slow, so use -e where possible)")]
|
#[structopt(short = "E", long, parse(from_os_str), help = "Excluded item(s)", long_help = "List of excluded item(s) which contains * wildcard(may be slow, so use -e where possible)")]
|
||||||
pub excluded_items: Vec<PathBuf>,
|
pub excluded_items: Vec<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ fn parse_delete_method(src: &str) -> Result<DeleteMethod, &'static str> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_min_size(src: &str) -> Result<u64, String> {
|
fn parse_minimal_file_size(src: &str) -> Result<u64, String> {
|
||||||
match src.parse::<u64>() {
|
match src.parse::<u64>() {
|
||||||
Ok(min_size) => {
|
Ok(min_size) => {
|
||||||
if min_size > 0 {
|
if min_size > 0 {
|
||||||
|
|
|
@ -278,7 +278,7 @@ impl BigFile {
|
||||||
self.number_of_files_to_check = number_of_files_to_check;
|
self.number_of_files_to_check = number_of_files_to_check;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Setting excluded items which needs to contains * wildcrard
|
/// Setting excluded items which needs to contains * wildcard
|
||||||
/// Are a lot of slower than absolute path, so it should be used to heavy
|
/// Are a lot of slower than absolute path, so it should be used to heavy
|
||||||
pub fn set_excluded_items(&mut self, excluded_items: String) {
|
pub fn set_excluded_items(&mut self, excluded_items: String) {
|
||||||
self.excluded_items.set_excluded_items(excluded_items, &mut self.text_messages);
|
self.excluded_items.set_excluded_items(excluded_items, &mut self.text_messages);
|
||||||
|
|
|
@ -10,7 +10,7 @@ impl ExcludedItems {
|
||||||
pub fn new() -> ExcludedItems {
|
pub fn new() -> ExcludedItems {
|
||||||
ExcludedItems { items: vec![] }
|
ExcludedItems { items: vec![] }
|
||||||
}
|
}
|
||||||
/// Setting excluded items which needs to contains * wildcrard
|
/// Setting excluded items which needs to contains * wildcard
|
||||||
/// Are a lot of slower than absolute path, so it should be used to heavy
|
/// Are a lot of slower than absolute path, so it should be used to heavy
|
||||||
pub fn set_excluded_items(&mut self, mut excluded_items: String, text_messages: &mut Messages) {
|
pub fn set_excluded_items(&mut self, mut excluded_items: String, text_messages: &mut Messages) {
|
||||||
let start_time: SystemTime = SystemTime::now();
|
let start_time: SystemTime = SystemTime::now();
|
||||||
|
|
|
@ -373,7 +373,7 @@ impl DuplicateFinder {
|
||||||
|
|
||||||
let mut hasher: blake3::Hasher = blake3::Hasher::new();
|
let mut hasher: blake3::Hasher = blake3::Hasher::new();
|
||||||
let mut buffer = [0u8; 16384];
|
let mut buffer = [0u8; 16384];
|
||||||
let mut readed_bytes: u64 = 0;
|
let mut read_bytes: u64 = 0;
|
||||||
loop {
|
loop {
|
||||||
let n = match file_handler.read(&mut buffer) {
|
let n = match file_handler.read(&mut buffer) {
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
|
@ -387,11 +387,11 @@ impl DuplicateFinder {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
readed_bytes += n as u64;
|
read_bytes += n as u64;
|
||||||
self.information.bytes_read_when_hashing += n as u64;
|
self.information.bytes_read_when_hashing += n as u64;
|
||||||
hasher.update(&buffer[..n]);
|
hasher.update(&buffer[..n]);
|
||||||
|
|
||||||
if self.check_method == CheckingMethod::HashMB && readed_bytes >= HASH_MB_LIMIT_BYTES {
|
if self.check_method == CheckingMethod::HashMB && read_bytes >= HASH_MB_LIMIT_BYTES {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ impl EmptyFolder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We need to check if parent of folder isn't also empty, because we wan't to delete only parent with two empty folders except this folders and at the end parent folder
|
// We need to check if parent of folder isn't also empty, because we want to delete only parent with two empty folders except this folders and at the end parent folder
|
||||||
let mut new_folders_list: BTreeMap<String, FolderEntry> = Default::default();
|
let mut new_folders_list: BTreeMap<String, FolderEntry> = Default::default();
|
||||||
for (name, folder_entry) in folders_checked {
|
for (name, folder_entry) in folders_checked {
|
||||||
if folder_entry.is_empty != FolderEmptiness::No && self.empty_folder_list.contains_key(&name) {
|
if folder_entry.is_empty != FolderEmptiness::No && self.empty_folder_list.contains_key(&name) {
|
||||||
|
|
Loading…
Reference in a new issue