Compare commits

...

2 commits

Author SHA1 Message Date
c9dbec730c ent show: show tags, if any 2025-07-20 00:04:11 -06:00
0d9a893087 ent show: simplify logic
This simplifies the code flow and gets rid of two levels of indentation.
2025-07-20 00:03:18 -06:00

View file

@ -285,10 +285,20 @@ fn handle_command(
Commands::Show { issue_id } => {
let issues = entomologist::database::read_issues_database(issues_database_source)?;
match issues.get_issue(issue_id) {
Some(issue) => {
let Some(issue) = issues.get_issue(issue_id) else {
return Err(anyhow::anyhow!("issue {} not found", issue_id));
};
println!("issue {}", issue_id);
println!("author: {}", issue.author);
if issue.tags.len() > 0 {
print!("tags: ");
let mut separator = "";
for tag in &issue.tags {
print!("{}{}", separator, tag);
separator = ", ";
}
println!("");
}
println!("creation_time: {}", issue.creation_time);
if let Some(done_time) = &issue.done_time {
println!("done_time: {}", done_time);
@ -311,11 +321,6 @@ fn handle_command(
println!("{}", comment.description);
}
}
None => {
return Err(anyhow::anyhow!("issue {} not found", issue_id));
}
}
}
Commands::State {
issue_id,