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 ba0862f5a6 - Show all commits

View file

@ -23,6 +23,9 @@ enum Commands {
/// Create a new issue.
New { description: Option<String> },
/// Edit the description of an issue.
Edit { issue_id: String },
}
fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<()> {
@ -46,6 +49,18 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<(
issue.edit_description()?;
println!("created new issue '{}'", issue.title());
}
Commands::Edit { issue_id } => {
let mut issues =
entomologist::issues::Issues::new_from_dir(std::path::Path::new(issues_dir))?;
match issues.issues.get_mut(issue_id) {
Some(issue) => {
issue.edit_description()?;
}
None => {
println!("issue {} not found", issue_id);
}
}
}
}
Ok(())