From bed89fdfdef553bb9ca7a5aaa615e16276d5ef3d Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 23 Dec 2025 20:41:39 -0800 Subject: [PATCH] feat(export): add --priority exact match filter (bd-au0.6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the --priority (-p) flag to bd export for filtering by exact priority, matching the behavior of bd list. This completes the comprehensive filtering support for bd export. The flag uses cmd.Flags().Changed() to properly handle P0 (priority 0), which would otherwise be interpreted as "not set" due to Go zero-value semantics. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/bd/export.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/bd/export.go b/cmd/bd/export.go index 9afe6dbc..bca6fd17 100644 --- a/cmd/bd/export.go +++ b/cmd/bd/export.go @@ -209,6 +209,17 @@ Examples: filter.LabelsAny = labelsAny } + // Priority exact match (use Changed() to properly handle P0) + if cmd.Flags().Changed("priority") { + priorityStr, _ := cmd.Flags().GetString("priority") + priority, err := validation.ValidatePriority(priorityStr) + if err != nil { + fmt.Fprintf(os.Stderr, "Error parsing --priority: %v\n", err) + os.Exit(1) + } + filter.Priority = &priority + } + // Priority ranges if cmd.Flags().Changed("priority-min") { priorityMin, err := validation.ValidatePriority(priorityMinStr) @@ -536,6 +547,7 @@ func init() { exportCmd.Flags().BoolVar(&jsonOutput, "json", false, "Output export statistics in JSON format") // Filter flags + registerPriorityFlag(exportCmd, "") exportCmd.Flags().StringP("assignee", "a", "", "Filter by assignee") exportCmd.Flags().StringP("type", "t", "", "Filter by type (bug, feature, task, epic, chore, merge-request, molecule, gate)") exportCmd.Flags().StringSliceP("label", "l", []string{}, "Filter by labels (AND: must have ALL)")