mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
ba7cc13145
There should be no reason to use gopkg.in versioned imports now that we're using go modules. I think, IANAE. gopkg.in kind of gets in the way of modules, as it only pulls over tagged releases from github.com -- this then means that you need to use go modules 'replace' syntax in the go.mod to use a non-versioned commit or branch. This is feasible, but kind of ugly. go modules defaults to pulling the latest version, so the default behavior is the same as when pulling go-jira.v1 from gopkg.in.
33 lines
840 B
Go
33 lines
840 B
Go
package jiracmd
|
|
|
|
import (
|
|
"github.com/coryb/figtree"
|
|
"github.com/coryb/oreo"
|
|
"github.com/go-jira/jira/jiracli"
|
|
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
|
)
|
|
|
|
func CmdTakeRegistry() *jiracli.CommandRegistryEntry {
|
|
opts := AssignOptions{}
|
|
|
|
return &jiracli.CommandRegistryEntry{
|
|
"Assign issue to yourself",
|
|
func(fig *figtree.FigTree, cmd *kingpin.CmdClause) error {
|
|
jiracli.LoadConfigs(cmd, fig, &opts)
|
|
return CmdAssignUsage(cmd, &opts)
|
|
},
|
|
func(o *oreo.Client, globals *jiracli.GlobalOptions) error {
|
|
if opts.Assignee == "" {
|
|
opts.Assignee = globals.User.Value
|
|
}
|
|
return CmdAssign(o, globals, &opts)
|
|
},
|
|
}
|
|
}
|
|
|
|
func CmdTakeUsage(cmd *kingpin.CmdClause, opts *AssignOptions) error {
|
|
jiracli.BrowseUsage(cmd, &opts.CommonOptions)
|
|
cmd.Arg("ISSUE", "issue to assign").Required().StringVar(&opts.Issue)
|
|
return nil
|
|
}
|