(724dc03) Add -o <owner> flag to comment subcommand

This commit is contained in:
2026-05-15 16:32:03 +02:00
parent 443586a583
commit dd5692d0a3
4 changed files with 58 additions and 3 deletions
+5 -2
View File
@@ -351,7 +351,7 @@ pub fn cmd_mv(ticket_id: &str, target_status: &str, force: bool, start: &Path) -
Ok(())
}
pub fn cmd_comment(ticket_id: &str, body: &str, start: &Path) -> Result<()> {
pub fn cmd_comment(ticket_id: &str, body: &str, owner: &Option<String>, start: &Path) -> Result<()> {
if body.is_empty() {
return Err(anyhow!("Comment body is required."));
}
@@ -371,7 +371,10 @@ pub fn cmd_comment(ticket_id: &str, body: &str, start: &Path) -> Result<()> {
let filename = format!("{}.md", timestamp);
let filepath = comments_dir.join(&filename);
let author = get_git_user().unwrap_or_else(|| "unknown".to_string());
let author = match owner {
Some(o) => o.clone(),
None => get_git_user().unwrap_or_else(|| "unknown".to_string()),
};
let comment_content = format!(
"**Comment**\n\