Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
2023-09-08 01:40:02 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
|
|
|
|
package flags
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
2022-10-25 00:40:00 +00:00
|
|
|
"time"
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
|
|
|
|
"code.gitea.io/sdk/gitea"
|
|
|
|
"code.gitea.io/tea/modules/context"
|
|
|
|
"code.gitea.io/tea/modules/task"
|
|
|
|
|
|
|
|
"github.com/araddon/dateparse"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
// StateFlag provides flag to specify issue/pr state, defaulting to "open"
|
|
|
|
var StateFlag = cli.StringFlag{
|
|
|
|
Name: "state",
|
|
|
|
Usage: "Filter by state (all|open|closed)",
|
|
|
|
DefaultText: "open",
|
|
|
|
}
|
|
|
|
|
|
|
|
// MilestoneFilterFlag is a CSV flag used to filter issues by milestones
|
|
|
|
var MilestoneFilterFlag = NewCsvFlag(
|
|
|
|
"milestones",
|
|
|
|
"milestones to match issues against",
|
|
|
|
[]string{"m"}, nil, nil)
|
|
|
|
|
|
|
|
// LabelFilterFlag is a CSV flag used to filter issues by labels
|
|
|
|
var LabelFilterFlag = NewCsvFlag(
|
|
|
|
"labels",
|
|
|
|
"labels to match issues against",
|
|
|
|
[]string{"L"}, nil, nil)
|
|
|
|
|
|
|
|
// PRListingFlags defines flags that should be available on pr listing flags.
|
|
|
|
var PRListingFlags = append([]cli.Flag{
|
|
|
|
&StateFlag,
|
|
|
|
&PaginationPageFlag,
|
|
|
|
&PaginationLimitFlag,
|
|
|
|
}, AllDefaultFlags...)
|
|
|
|
|
|
|
|
// IssueListingFlags defines flags that should be available on issue listing flags.
|
|
|
|
var IssueListingFlags = append([]cli.Flag{
|
|
|
|
&StateFlag,
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "kind",
|
|
|
|
Aliases: []string{"K"},
|
2022-01-31 23:11:37 +00:00
|
|
|
Usage: "Whether to return `issues`, `pulls`, or `all` (you can use this to apply advanced search filters to PRs)",
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
DefaultText: "issues",
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "keyword",
|
|
|
|
Aliases: []string{"k"},
|
|
|
|
Usage: "Filter by search string",
|
|
|
|
},
|
|
|
|
LabelFilterFlag,
|
|
|
|
MilestoneFilterFlag,
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "author",
|
|
|
|
Aliases: []string{"A"},
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "assignee",
|
|
|
|
Aliases: []string{"a"},
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "mentions",
|
|
|
|
Aliases: []string{"M"},
|
|
|
|
},
|
2023-06-06 13:25:36 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "owner",
|
|
|
|
Aliases: []string{"org"},
|
|
|
|
},
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "from",
|
|
|
|
Aliases: []string{"F"},
|
|
|
|
Usage: "Filter by activity after this date",
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "until",
|
|
|
|
Aliases: []string{"u"},
|
|
|
|
Usage: "Filter by activity before this date",
|
|
|
|
},
|
|
|
|
&PaginationPageFlag,
|
|
|
|
&PaginationLimitFlag,
|
|
|
|
}, AllDefaultFlags...)
|
|
|
|
|
2022-10-25 00:40:00 +00:00
|
|
|
// issuePRFlags defines shared flags between flags IssuePRCreateFlags and IssuePREditFlags
|
|
|
|
var issuePRFlags = append([]cli.Flag{
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "title",
|
|
|
|
Aliases: []string{"t"},
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "description",
|
|
|
|
Aliases: []string{"d"},
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
2022-10-25 00:40:00 +00:00
|
|
|
Name: "referenced-version",
|
|
|
|
Aliases: []string{"v"},
|
|
|
|
Usage: "commit-hash or tag name to assign",
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
2022-10-25 00:40:00 +00:00
|
|
|
Name: "milestone",
|
|
|
|
Aliases: []string{"m"},
|
|
|
|
Usage: "Milestone to assign",
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "deadline",
|
|
|
|
Aliases: []string{"D"},
|
|
|
|
Usage: "Deadline timestamp to assign",
|
|
|
|
},
|
2022-10-25 00:40:00 +00:00
|
|
|
}, LoginRepoFlags...)
|
|
|
|
|
|
|
|
// IssuePRCreateFlags defines flags for creation of issues and PRs
|
|
|
|
var IssuePRCreateFlags = append([]cli.Flag{
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
&cli.StringFlag{
|
2022-10-25 00:40:00 +00:00
|
|
|
Name: "assignees",
|
|
|
|
Aliases: []string{"a"},
|
|
|
|
Usage: "Comma-separated list of usernames to assign",
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
},
|
2022-10-25 00:40:00 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "labels",
|
|
|
|
Aliases: []string{"L"},
|
|
|
|
Usage: "Comma-separated list of labels to assign",
|
|
|
|
},
|
|
|
|
}, issuePRFlags...)
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
|
2022-10-25 00:40:00 +00:00
|
|
|
// GetIssuePRCreateFlags parses all IssuePREditFlags
|
|
|
|
func GetIssuePRCreateFlags(ctx *context.TeaContext) (*gitea.CreateIssueOption, error) {
|
Implement more issue filters (#400)
This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15:
```
--state value Filter by state (all|open|closed) (default: open)
--keyword value, -k value Filter by search string
--labels value, -L value Comma-separated list of labels to match issues against.
--milestones value, -m value Comma-separated list of milestones to match issues against.
--author value, -A value
--assignee value, -a value
--mentions value, -M value
--from value, -F value Filter by activity after this date
--until value, -u value Filter by activity before this date
```
Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`)
fixes #376, related #323
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/400
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2021-12-02 19:26:48 +00:00
|
|
|
opts := gitea.CreateIssueOption{
|
|
|
|
Title: ctx.String("title"),
|
|
|
|
Body: ctx.String("description"),
|
|
|
|
Assignees: strings.Split(ctx.String("assignees"), ","),
|
|
|
|
}
|
|
|
|
var err error
|
|
|
|
|
|
|
|
date := ctx.String("deadline")
|
|
|
|
if date != "" {
|
|
|
|
t, err := dateparse.ParseAny(date)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
opts.Deadline = &t
|
|
|
|
}
|
|
|
|
|
|
|
|
client := ctx.Login.Client()
|
|
|
|
|
|
|
|
labelNames := strings.Split(ctx.String("labels"), ",")
|
|
|
|
if len(labelNames) != 0 {
|
|
|
|
if client == nil {
|
|
|
|
client = ctx.Login.Client()
|
|
|
|
}
|
|
|
|
if opts.Labels, err = task.ResolveLabelNames(client, ctx.Owner, ctx.Repo, labelNames); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if milestoneName := ctx.String("milestone"); len(milestoneName) != 0 {
|
|
|
|
if client == nil {
|
|
|
|
client = ctx.Login.Client()
|
|
|
|
}
|
|
|
|
ms, _, err := client.GetMilestoneByName(ctx.Owner, ctx.Repo, milestoneName)
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("Milestone '%s' not found", milestoneName)
|
|
|
|
}
|
|
|
|
opts.Milestone = ms.ID
|
|
|
|
}
|
|
|
|
|
|
|
|
return &opts, nil
|
|
|
|
}
|
2022-10-25 00:40:00 +00:00
|
|
|
|
|
|
|
// IssuePREditFlags defines flags for editing properties of issues and PRs
|
|
|
|
var IssuePREditFlags = append([]cli.Flag{
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "add-assignees",
|
|
|
|
Aliases: []string{"a"},
|
|
|
|
Usage: "Comma-separated list of usernames to assign",
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "add-labels",
|
|
|
|
Aliases: []string{"L"},
|
|
|
|
Usage: "Comma-separated list of labels to assign. Takes precedence over --remove-labels",
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "remove-labels",
|
|
|
|
Usage: "Comma-separated list of labels to remove",
|
|
|
|
},
|
|
|
|
}, issuePRFlags...)
|
|
|
|
|
|
|
|
// GetIssuePREditFlags parses all IssuePREditFlags
|
|
|
|
func GetIssuePREditFlags(ctx *context.TeaContext) (*task.EditIssueOption, error) {
|
|
|
|
opts := task.EditIssueOption{}
|
|
|
|
if ctx.IsSet("title") {
|
|
|
|
val := ctx.String("title")
|
|
|
|
opts.Title = &val
|
|
|
|
}
|
|
|
|
if ctx.IsSet("description") {
|
|
|
|
val := ctx.String("description")
|
|
|
|
opts.Body = &val
|
|
|
|
}
|
|
|
|
if ctx.IsSet("referenced-version") {
|
|
|
|
val := ctx.String("referenced-version")
|
|
|
|
opts.Ref = &val
|
|
|
|
}
|
|
|
|
if ctx.IsSet("milestone") {
|
|
|
|
val := ctx.String("milestone")
|
|
|
|
opts.Milestone = &val
|
|
|
|
}
|
|
|
|
if ctx.IsSet("deadline") {
|
|
|
|
date := ctx.String("deadline")
|
|
|
|
if date == "" {
|
|
|
|
opts.Deadline = &time.Time{}
|
|
|
|
} else {
|
|
|
|
t, err := dateparse.ParseAny(date)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
opts.Deadline = &t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ctx.IsSet("add-assignees") {
|
|
|
|
val := ctx.String("add-assignees")
|
|
|
|
opts.AddAssignees = strings.Split(val, ",")
|
|
|
|
}
|
|
|
|
if ctx.IsSet("add-labels") {
|
|
|
|
val := ctx.String("add-labels")
|
|
|
|
opts.AddLabels = strings.Split(val, ",")
|
|
|
|
}
|
|
|
|
if ctx.IsSet("remove-labels") {
|
|
|
|
val := ctx.String("remove-labels")
|
|
|
|
opts.RemoveLabels = strings.Split(val, ",")
|
|
|
|
}
|
|
|
|
return &opts, nil
|
|
|
|
}
|