aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat-cli/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'fatcat-cli/src/commands.rs')
-rw-r--r--fatcat-cli/src/commands.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/fatcat-cli/src/commands.rs b/fatcat-cli/src/commands.rs
index eb7d5a8..6f52614 100644
--- a/fatcat-cli/src/commands.rs
+++ b/fatcat-cli/src/commands.rs
@@ -292,6 +292,9 @@ pub fn print_search_table(results: SearchResults, entity_type: SearchEntityType)
SearchEntityType::File => {
writeln!(tw, "ident\tsha1\tsize_bytes\tmimetype")?;
}
+ SearchEntityType::Scholar=> {
+ writeln!(tw, "key\ttype\tstage\tyear\tcontainer_name\ttitle")?;
+ }
}
for hit in results {
let hit = hit?;
@@ -331,6 +334,20 @@ pub fn print_search_table(results: SearchResults, entity_type: SearchEntityType)
hit["mimetype"].as_str().unwrap_or("-"),
)?;
}
+ SearchEntityType::Scholar => {
+ writeln!(
+ tw,
+ "{}\t{}\t{}\t{}\t{}\t{}",
+ hit["key"].as_str().unwrap_or("-"),
+ hit["biblio"]["release_type"].as_str().unwrap_or("-"),
+ hit["biblio"]["release_stage"].as_str().unwrap_or("-"),
+ hit["biblio"]["release_year"]
+ .as_u64()
+ .map_or("-".to_string(), |v| v.to_string()),
+ hit["biblio"]["container_name"].as_str().unwrap_or("-"),
+ hit["biblio"]["title"].as_str().unwrap_or("-"),
+ )?;
+ }
}
}
tw.flush()?;