From 4307fc8941324d20e50548b43a7baec7cbef2e5f Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 12 Jul 2025 11:23:56 -0600 Subject: [PATCH] ent list: show tags --- src/bin/ent/main.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/bin/ent/main.rs b/src/bin/ent/main.rs index 655d16a..1d7b87a 100644 --- a/src/bin/ent/main.rs +++ b/src/bin/ent/main.rs @@ -207,7 +207,32 @@ fn handle_command( Some(assignee) => format!(" (👉 {})", assignee), None => String::from(""), }; - println!("{} {} {}{}", uuid, comments, issue.title(), assignee); + let tags = match &issue.tags.len() { + 0 => String::from(""), + _ => { + // Could use `format!(" {:?}", issue.tags)` + // here, but that results in `["tag1", "TAG2", + // "i-am-also-a-tag"]` and i don't want the + // double-quotes around each tag. + let mut tags = String::from(" ["); + let mut separator = ""; + for tag in &issue.tags { + tags.push_str(separator); + tags.push_str(tag); + separator = ", "; + } + tags.push_str("]"); + tags + } + }; + println!( + "{} {} {}{}{}", + uuid, + comments, + issue.title(), + assignee, + tags + ); } println!(""); }