summaryrefslogtreecommitdiffstats
path: root/src/core.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.rs')
-rw-r--r--src/core.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core.rs b/src/core.rs
index 60c73e7..16aaf8f 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -3,8 +3,7 @@ use crate::display;
use crate::flags::{Display, Flags, IconTheme, Layout, WhenFlag};
use crate::icon::{self, Icons};
use crate::meta::Meta;
-use crate::sort;
-use std::fs;
+use crate::{print_error, print_output, sort};
use std::path::PathBuf;
#[cfg(not(target_os = "windows"))]
@@ -83,15 +82,10 @@ impl Core {
};
for path in paths {
- if let Err(err) = fs::canonicalize(&path) {
- eprintln!("cannot access '{}': {}", path.display(), err);
- continue;
- }
-
let mut meta = match Meta::from_path(&path) {
Ok(meta) => meta,
Err(err) => {
- eprintln!("cannot access '{}': {}", path.display(), err);
+ print_error!("lsd: {}: {}\n", path.display(), err);
continue;
}
};
@@ -107,7 +101,7 @@ impl Core {
meta_list.push(meta);
}
Err(err) => {
- eprintln!("cannot access '{}': {}", path.display(), err);
+ print_error!("lsd: {}: {}\n", path.display(), err);
continue;
}
};
@@ -140,6 +134,6 @@ impl Core {
display::grid(&metas, &self.flags, &self.colors, &self.icons)
};
- print!("{}", output);
+ print_output!("{}", output);
}
}