ent-new-edit-show #3

Merged
seb merged 6 commits from ent-new-edit-show into main 2025-07-07 12:04:50 -06:00
Showing only changes of commit 3f2d3b1520 - Show all commits

View file

@ -26,6 +26,9 @@ enum Commands {
/// Edit the description of an issue. /// Edit the description of an issue.
Edit { issue_id: String }, 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<()> { 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(()) Ok(())