|
|
@ -18,6 +18,11 @@ impl Builtin for Ls { |
|
|
|
|
|
|
|
//for entry in entries.by_ref().into_iter() {}
|
|
|
|
|
|
|
|
println!(
|
|
|
|
"{} | dir | size | modified |",
|
|
|
|
right_padding(" filename", 20)
|
|
|
|
);
|
|
|
|
|
|
|
|
for entry in entries {
|
|
|
|
let Ok(entry) = entry else {
|
|
|
|
eprintln!("Couldn't get directory entry");
|
|
|
@ -83,11 +88,11 @@ fn format_line( |
|
|
|
modified: DateTime<Local>,
|
|
|
|
) -> String {
|
|
|
|
format!(
|
|
|
|
"{} | {:4} | {:6} | {}",
|
|
|
|
"{} | {:4} | {:6} | {} |",
|
|
|
|
right_padding(file_name, max_name_len),
|
|
|
|
file_type,
|
|
|
|
format_filesize(file_size),
|
|
|
|
format_date(modified)
|
|
|
|
right_padding(&format_date(modified), 10)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|