Compare commits

...

2 Commits

Author SHA1 Message Date
Mike Dilger
95ee2a572a
chorus_cmd: fetch_by_id 2025-02-10 06:57:08 +13:00
Mike Dilger
685fa91296
Rename 2025-02-07 08:25:17 +13:00
2 changed files with 11 additions and 0 deletions

View File

@ -56,6 +56,17 @@ fn main() -> Result<(), Error> {
}
println!("Done.");
}
"fetch_by_id" => {
let idstr = args
.next()
.ok_or::<Error>(ChorusError::General("ID argument missing".to_owned()).into())?;
let id: Id = Id::read_hex(idstr.as_bytes())?;
if let Some(event) = store.get_event_by_id(id)? {
println!("{event}");
} else {
println!("Not found.");
}
}
_ => {
return Err(ChorusError::General("Unknown command.".to_owned()).into());
}