feat(export): add --priority exact match filter (bd-au0.6)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user