feat(list): Add type aliases for --type flag (gt-pvhsv)
Add convenience aliases for common type names: - mr → merge-request - feat → feature - mol → molecule Applied to bd list, bd ready, and bd export commands. Case-insensitive matching (MR, Mr, mr all work). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,23 @@ package util
|
||||
|
||||
import "strings"
|
||||
|
||||
// issueTypeAliases maps shorthand type names to canonical types
|
||||
var issueTypeAliases = map[string]string{
|
||||
"mr": "merge-request",
|
||||
"feat": "feature",
|
||||
"mol": "molecule",
|
||||
}
|
||||
|
||||
// NormalizeIssueType expands type aliases to their canonical forms.
|
||||
// For example: "mr" -> "merge-request", "feat" -> "feature", "mol" -> "molecule"
|
||||
// Returns the input unchanged if it's not an alias.
|
||||
func NormalizeIssueType(t string) string {
|
||||
if canonical, ok := issueTypeAliases[strings.ToLower(t)]; ok {
|
||||
return canonical
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
// NormalizeLabels trims whitespace, removes empty strings, and deduplicates labels
|
||||
// while preserving order.
|
||||
func NormalizeLabels(ss []string) []string {
|
||||
|
||||
Reference in New Issue
Block a user