feat: add digest type and value to info output
This commit is contained in:
@@ -108,12 +108,19 @@ pub fn mode_info(
|
||||
file_size_cell,
|
||||
]));
|
||||
|
||||
let compression_engine =
|
||||
get_compression_engine(compression_type).expect("Unable to get compression engine");
|
||||
let magic = compression_engine.magic(item_path.clone());
|
||||
let file_magic_cell = match compression_type {
|
||||
Ok(compression_type) => {
|
||||
let compression_engine =
|
||||
get_compression_engine(compression_type).expect("Unable to get compression engine");
|
||||
let magic = compression_engine.magic(item_path.clone());
|
||||
|
||||
let file_magic_cell = match magic {
|
||||
Ok(magic) => Cell::new(magic.as_str()),
|
||||
match magic {
|
||||
Ok(magic) => Cell::new(magic.as_str()),
|
||||
Err(e) => Cell::new(&e.to_string())
|
||||
.with_style(Attr::ForegroundColor(prettytable::color::RED))
|
||||
.with_style(Attr::Bold),
|
||||
}
|
||||
},
|
||||
Err(e) => Cell::new(&e.to_string())
|
||||
.with_style(Attr::ForegroundColor(prettytable::color::RED))
|
||||
.with_style(Attr::Bold),
|
||||
@@ -129,6 +136,20 @@ pub fn mode_info(
|
||||
Cell::new(&item_tags.join(" ")),
|
||||
]));
|
||||
|
||||
if let Some(digest_type) = &item.digest_type {
|
||||
table.add_row(Row::new(vec![
|
||||
Cell::new("Digest Type").with_style(Attr::Bold),
|
||||
Cell::new(digest_type),
|
||||
]));
|
||||
}
|
||||
|
||||
if let Some(digest_value) = &item.digest_value {
|
||||
table.add_row(Row::new(vec![
|
||||
Cell::new("Digest Value").with_style(Attr::Bold),
|
||||
Cell::new(digest_value),
|
||||
]));
|
||||
}
|
||||
|
||||
for meta in crate::db::get_item_meta(conn, &item)? {
|
||||
let meta_name = format!("Meta: {}", &meta.name);
|
||||
table.add_row(Row::new(vec![
|
||||
|
||||
Reference in New Issue
Block a user