|
@@ -51,16 +51,16 @@ fn main() {
|
|
|
.help("Path to find size of"))
|
|
|
.get_matches();
|
|
|
|
|
|
- let total = get_fill(String::from(matches.value_of("path").unwrap()));
|
|
|
+ let path_string = String::from(matches.value_of("path").unwrap());
|
|
|
+ let total = get_fill(path_string);
|
|
|
let bytes_total = total.unwrap();
|
|
|
let kb_total = bytes_total as f64 / 1024.0;
|
|
|
let mb_total = bytes_total as f64 / 1024.0 / 1024.0;
|
|
|
let gb_total = bytes_total as f64 / 1024.0 / 1024.0 / 1024.0;
|
|
|
let tb_total = bytes_total as f64 / 1024.0 / 1024.0 / 1024.0 / 1024.0;
|
|
|
- println!("Total of test dir in B is: {}",bytes_total);
|
|
|
- println!("Total of test dir in KB is: {}",kb_total);
|
|
|
- println!("Total of test dir in MB is: {}",mb_total);
|
|
|
- println!("Total of test dir in GB is: {}",gb_total);
|
|
|
- println!("Total of test dir in TB is: {}",tb_total);
|
|
|
+ // Recreate this cause we used if for get_fill already
|
|
|
+ let path_string = String::from(matches.value_of("path").unwrap());
|
|
|
+ print!("Total of {} is: | {} B | {} KB | {} MB | {} GB | {} TB |\n",
|
|
|
+ path_string,bytes_total,kb_total,mb_total,gb_total,tb_total);
|
|
|
|
|
|
}
|