add ent show

This commit is contained in:
Sebastian Kuzminsky 2025-07-06 00:21:25 -06:00
parent ba0862f5a6
commit 3f2d3b1520

View file

@ -26,6 +26,9 @@ enum Commands {
/// Edit the description of an issue.
Edit { issue_id: String },
/// Show the full description of an issue.
Show { issue_id: String },
}
fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<()> {
@ -61,6 +64,21 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<(
}
}
}
Commands::Show { issue_id } => {
let issues =
entomologist::issues::Issues::new_from_dir(std::path::Path::new(issues_dir))?;
match issues.issues.get(issue_id) {
Some(issue) => {
println!("issue {}", issue_id);
println!("state {:?}", issue.state);
println!("");
println!("{}", issue.description);
}
None => {
println!("issue {} not found", issue_id);
}
}
}
}
Ok(())