mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
move commands from jiracli package to jiracmd package
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package jiracmd
|
||||
|
||||
import (
|
||||
"github.com/coryb/figtree"
|
||||
"github.com/coryb/oreo"
|
||||
"gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli"
|
||||
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
||||
)
|
||||
|
||||
func CmdTakeRegistry(fig *figtree.FigTree, o *oreo.Client) *jiracli.CommandRegistryEntry {
|
||||
opts := AssignOptions{}
|
||||
|
||||
return &jiracli.CommandRegistryEntry{
|
||||
"Assign issue to yourself",
|
||||
func() error {
|
||||
opts.Assignee = opts.User.Value
|
||||
return CmdAssign(o, &opts)
|
||||
},
|
||||
func(cmd *kingpin.CmdClause) error {
|
||||
jiracli.LoadConfigs(cmd, fig, &opts)
|
||||
return CmdAssignUsage(cmd, &opts)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func CmdTakeUsage(cmd *kingpin.CmdClause, opts *AssignOptions) error {
|
||||
if err := jiracli.GlobalUsage(cmd, &opts.GlobalOptions); err != nil {
|
||||
return err
|
||||
}
|
||||
jiracli.BrowseUsage(cmd, &opts.GlobalOptions)
|
||||
cmd.Arg("ISSUE", "issue to assign").Required().StringVar(&opts.Issue)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user