empty-descriptions-and-dropped-worktrees #15

Merged
seb merged 10 commits from empty-descriptions-and-dropped-worktrees into main 2025-07-10 09:48:22 -06:00
Showing only changes of commit e09e4b9cb7 - Show all commits

View file

@ -132,18 +132,24 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<(
} }
} }
Commands::New { Commands::New { description } => {
description: Some(description),
} => {
let mut issue = entomologist::issue::Issue::new(issues_dir)?; let mut issue = entomologist::issue::Issue::new(issues_dir)?;
issue.set_description(description)?; let r = match description {
Some(description) => issue.set_description(description),
None => issue.edit_description(),
};
match r {
Err(entomologist::issue::IssueError::EmptyDescription) => {
println!("no new issue created");
return Ok(());
}
Err(e) => {
return Err(e.into());
}
Ok(()) => {
println!("created new issue '{}'", issue.title()); println!("created new issue '{}'", issue.title());
} }
}
Commands::New { description: None } => {
let mut issue = entomologist::issue::Issue::new(issues_dir)?;
issue.edit_description()?;
println!("created new issue '{}'", issue.title());
} }
Commands::Edit { issue_id } => { Commands::Edit { issue_id } => {