feat: support multiple labels in issue create (--label id1,id2)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
15972095207 2026-06-04 08:59:33 +08:00
parent 7f53548244
commit ed7a2bbcd6
1 changed files with 12 additions and 6 deletions

View File

@ -82,12 +82,18 @@ func Shortcuts() []*common.Shortcut {
if m := ctx.Arg("milestone"); m != "" {
body["fixed_version_id"] = m
}
if l := ctx.Arg("label"); l != "" {
body["issue_tag_ids"] = []int{func() int {
id, _ := strconv.Atoi(l)
return id
}()}
}
if l := ctx.Arg("label"); l != "" {
var tagIDs []int
for _, s := range strings.Split(l, ",") {
s = strings.TrimSpace(s)
if id, err := strconv.Atoi(s); err == nil {
tagIDs = append(tagIDs, id)
}
}
if len(tagIDs) > 0 {
body["issue_tag_ids"] = tagIDs
}
}
env, err := ctx.CallAPI("POST", v1RepoPath(ctx)+"/issues", body)
if err != nil {
return err