ent list: add filtering based on tags

This commit is contained in:
Sebastian Kuzminsky 2025-07-12 14:24:40 -06:00
parent 28db7669f4
commit 9d4409c008
3 changed files with 50 additions and 0 deletions

View file

@ -34,6 +34,10 @@ enum Commands {
/// "assignee": Comma-separated list of assignees to list.
/// Defaults to all assignees if not set.
///
/// "tag": Comma-separated list of tags to include or exclude
/// (if prefixed with "-"). If omitted, defaults to including
/// all tags and excluding none.
///
#[arg(default_value_t = String::from("state=New,Backlog,Blocked,InProgress"))]
filter: String,
},
@ -187,6 +191,17 @@ fn handle_command(
}
}
if filter.include_tags.len() > 0 {
if !issue.has_any_tag(&filter.include_tags) {
continue;
}
}
if filter.exclude_tags.len() > 0 {
if issue.has_any_tag(&filter.exclude_tags) {
continue;
}
}
// This issue passed all the filters, include it in list.
uuids_by_state
.entry(issue.state.clone())