Fixes some typos

This commit is contained in:
Rafał Mikrut 2020-10-07 10:34:15 +02:00
parent f00219d6d0
commit 1a87a69116
5 changed files with 21 additions and 21 deletions

View File

@ -9,10 +9,10 @@ pub enum Commands {
#[structopt(flatten)]
directories: Directories,
#[structopt(flatten)]
excluded_directories: ExludedDirectories,
excluded_directories: ExcludedDirectories,
#[structopt(flatten)]
excluded_items: ExludedItems,
#[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")]
excluded_items: ExcludedItems,
#[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,
#[structopt(flatten)]
allowed_extensions: AllowedExtensions,
@ -25,7 +25,7 @@ pub enum Commands {
#[structopt(flatten)]
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 {
#[structopt(flatten)]
directories: Directories,
@ -39,9 +39,9 @@ pub enum Commands {
#[structopt(flatten)]
directories: Directories,
#[structopt(flatten)]
excluded_directories: ExludedDirectories,
excluded_directories: ExcludedDirectories,
#[structopt(flatten)]
excluded_items: ExludedItems,
excluded_items: ExcludedItems,
#[structopt(flatten)]
allowed_extensions: AllowedExtensions,
#[structopt(short, long, default_value = "50", help = "Number of files to be shown")]
@ -56,9 +56,9 @@ pub enum Commands {
#[structopt(flatten)]
directories: Directories,
#[structopt(flatten)]
excluded_directories: ExludedDirectories,
excluded_directories: ExcludedDirectories,
#[structopt(flatten)]
excluded_items: ExludedItems,
excluded_items: ExcludedItems,
#[structopt(flatten)]
allowed_extensions: AllowedExtensions,
#[structopt(short = "D", long, help = "Delete found files")]
@ -73,9 +73,9 @@ pub enum Commands {
#[structopt(flatten)]
directories: Directories,
#[structopt(flatten)]
excluded_directories: ExludedDirectories,
excluded_directories: ExcludedDirectories,
#[structopt(flatten)]
excluded_items: ExludedItems,
excluded_items: ExcludedItems,
#[structopt(short = "D", long, help = "Delete found files")]
delete_files: bool,
#[structopt(flatten)]
@ -92,14 +92,14 @@ pub struct Directories {
}
#[derive(Debug, StructOpt)]
pub struct ExludedDirectories {
#[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)")]
pub struct ExcludedDirectories {
#[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>,
}
#[derive(Debug, StructOpt)]
pub struct ExludedItems {
#[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)")]
pub struct ExcludedItems {
#[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>,
}
@ -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>() {
Ok(min_size) => {
if min_size > 0 {

View File

@ -278,7 +278,7 @@ impl BigFile {
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
pub fn set_excluded_items(&mut self, excluded_items: String) {
self.excluded_items.set_excluded_items(excluded_items, &mut self.text_messages);

View File

@ -10,7 +10,7 @@ impl ExcludedItems {
pub fn new() -> ExcludedItems {
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
pub fn set_excluded_items(&mut self, mut excluded_items: String, text_messages: &mut Messages) {
let start_time: SystemTime = SystemTime::now();

View File

@ -373,7 +373,7 @@ impl DuplicateFinder {
let mut hasher: blake3::Hasher = blake3::Hasher::new();
let mut buffer = [0u8; 16384];
let mut readed_bytes: u64 = 0;
let mut read_bytes: u64 = 0;
loop {
let n = match file_handler.read(&mut buffer) {
Ok(t) => t,
@ -387,11 +387,11 @@ impl DuplicateFinder {
break;
}
readed_bytes += n as u64;
read_bytes += n as u64;
self.information.bytes_read_when_hashing += n as u64;
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;
}
}

View File

@ -230,7 +230,7 @@ impl EmptyFolder {
}
}
} 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();
for (name, folder_entry) in folders_checked {
if folder_entry.is_empty != FolderEmptiness::No && self.empty_folder_list.contains_key(&name) {