(724dc03) Add -o <owner> flag to comment subcommand
This commit is contained in:
+5
-2
@@ -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\
|
||||
|
||||
Reference in New Issue
Block a user