mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 17:46:42 +01:00
add hash column; update tengri
This commit is contained in:
parent
c3f826a7d4
commit
72bd6148d6
4 changed files with 46 additions and 32 deletions
|
|
@ -24,8 +24,8 @@ pub(crate) type Usually<T> = std::result::Result<T, Box<dyn std::error::Error>>;
|
|||
pub(crate) type Perhaps<T> = Usually<Option<T>>;
|
||||
|
||||
pub(crate) const PAGE_SIZE: usize = 10;
|
||||
pub(crate) const COLUMN_COUNT: usize = 5;
|
||||
pub(crate) const COLUMN_WIDTHS: [u16; COLUMN_COUNT] = [60, 20, 20, 5, 20];
|
||||
pub(crate) const COLUMN_COUNT: usize = 6;
|
||||
pub(crate) const COLUMN_WIDTHS: [u16; COLUMN_COUNT] = [16, 60, 20, 20, 5, 20];
|
||||
|
||||
fn cli () -> clap::Command {
|
||||
command!()
|
||||
|
|
@ -111,6 +111,7 @@ impl Taggart {
|
|||
}
|
||||
let depth = entry.depth();
|
||||
let path = entry.into_path();
|
||||
let short_path: PathBuf = path.strip_prefix(&root)?.into();
|
||||
let (is_dir, is_mus, is_img, hash, file_type) = if path.is_dir() {
|
||||
(Some(Default::default()), None, None, None, None)
|
||||
} else {
|
||||
|
|
@ -126,11 +127,11 @@ impl Taggart {
|
|||
Some(&"image/png") => Some(Default::default()),
|
||||
_ => None,
|
||||
};
|
||||
println!("{hash} {file_type:?} ({}b)\n{}\n", bytes.len(), path.display());
|
||||
println!("{hash} {:>10}b {}", bytes.len(), short_path.display());
|
||||
(None, is_mus, is_img, Some(hash), Some(file_type))
|
||||
};
|
||||
paths.push(Entry {
|
||||
path: path.strip_prefix(&root)?.into(),
|
||||
path: short_path,
|
||||
is_dir,
|
||||
is_mus,
|
||||
is_img,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue