From c0358eb67cfbfe6041de682ee91e8f58eb916a8f Mon Sep 17 00:00:00 2001 From: Cory Bennett Date: Mon, 4 Sep 2017 17:53:01 -0700 Subject: [PATCH] refactor to allow for --insecure and --unixproxy arguments --- cmd/jira/main.go | 88 ++++++++++++++++++------------------ jiracli/cli.go | 29 ++++++++++-- jiracli/unixproxy.go | 12 ++--- jiracmd/assign.go | 4 +- jiracmd/block.go | 4 +- jiracmd/browse.go | 3 +- jiracmd/comment.go | 4 +- jiracmd/componentAdd.go | 4 +- jiracmd/components.go | 4 +- jiracmd/create.go | 4 +- jiracmd/createmeta.go | 4 +- jiracmd/dup.go | 4 +- jiracmd/edit.go | 4 +- jiracmd/editmeta.go | 4 +- jiracmd/exportTemplates.go | 3 +- jiracmd/fields.go | 4 +- jiracmd/issuelink.go | 4 +- jiracmd/issuelinktypes.go | 4 +- jiracmd/issuetypes.go | 4 +- jiracmd/labelsAdd.go | 4 +- jiracmd/labelsRemove.go | 4 +- jiracmd/labelsSet.go | 4 +- jiracmd/list.go | 4 +- jiracmd/login.go | 4 +- jiracmd/logout.go | 4 +- jiracmd/rank.go | 4 +- jiracmd/request.go | 4 +- jiracmd/subtask.go | 4 +- jiracmd/take.go | 4 +- jiracmd/transition.go | 4 +- jiracmd/transitions.go | 4 +- jiracmd/unassign.go | 4 +- jiracmd/unexportTemplates.go | 3 +- jiracmd/view.go | 4 +- jiracmd/vote.go | 4 +- jiracmd/watch.go | 4 +- jiracmd/worklogAdd.go | 4 +- jiracmd/worklogList.go | 4 +- 38 files changed, 146 insertions(+), 120 deletions(-) diff --git a/cmd/jira/main.go b/cmd/jira/main.go index dc64fb00..70fbe85b 100644 --- a/cmd/jira/main.go +++ b/cmd/jira/main.go @@ -107,178 +107,178 @@ func main() { registry := []jiracli.CommandRegistry{ jiracli.CommandRegistry{ Command: "login", - Entry: jiracmd.CmdLoginRegistry(o), + Entry: jiracmd.CmdLoginRegistry(), }, jiracli.CommandRegistry{ Command: "logout", - Entry: jiracmd.CmdLogoutRegistry(o), + Entry: jiracmd.CmdLogoutRegistry(), }, jiracli.CommandRegistry{ Command: "list", Aliases: []string{"ls"}, - Entry: jiracmd.CmdListRegistry(o), + Entry: jiracmd.CmdListRegistry(), }, jiracli.CommandRegistry{ Command: "view", - Entry: jiracmd.CmdViewRegistry(o), + Entry: jiracmd.CmdViewRegistry(), }, jiracli.CommandRegistry{ Command: "create", - Entry: jiracmd.CmdCreateRegistry(o), + Entry: jiracmd.CmdCreateRegistry(), }, jiracli.CommandRegistry{ Command: "edit", - Entry: jiracmd.CmdEditRegistry(o), + Entry: jiracmd.CmdEditRegistry(), }, jiracli.CommandRegistry{ Command: "comment", - Entry: jiracmd.CmdCommentRegistry(o), + Entry: jiracmd.CmdCommentRegistry(), }, jiracli.CommandRegistry{ Command: "worklog list", - Entry: jiracmd.CmdWorklogListRegistry(o), + Entry: jiracmd.CmdWorklogListRegistry(), Default: true, }, jiracli.CommandRegistry{ Command: "worklog add", - Entry: jiracmd.CmdWorklogAddRegistry(o), + Entry: jiracmd.CmdWorklogAddRegistry(), }, jiracli.CommandRegistry{ Command: "fields", - Entry: jiracmd.CmdFieldsRegistry(o), + Entry: jiracmd.CmdFieldsRegistry(), }, jiracli.CommandRegistry{ Command: "createmeta", - Entry: jiracmd.CmdCreateMetaRegistry(o), + Entry: jiracmd.CmdCreateMetaRegistry(), }, jiracli.CommandRegistry{ Command: "editmeta", - Entry: jiracmd.CmdEditMetaRegistry(o), + Entry: jiracmd.CmdEditMetaRegistry(), }, jiracli.CommandRegistry{ Command: "subtask", - Entry: jiracmd.CmdSubtaskRegistry(o), + Entry: jiracmd.CmdSubtaskRegistry(), }, jiracli.CommandRegistry{ Command: "dup", - Entry: jiracmd.CmdDupRegistry(o), + Entry: jiracmd.CmdDupRegistry(), }, jiracli.CommandRegistry{ Command: "block", - Entry: jiracmd.CmdBlockRegistry(o), + Entry: jiracmd.CmdBlockRegistry(), }, jiracli.CommandRegistry{ Command: "issuelink", - Entry: jiracmd.CmdIssueLinkRegistry(o), + Entry: jiracmd.CmdIssueLinkRegistry(), }, jiracli.CommandRegistry{ Command: "issuelinktypes", - Entry: jiracmd.CmdIssueLinkTypesRegistry(o), + Entry: jiracmd.CmdIssueLinkTypesRegistry(), }, jiracli.CommandRegistry{ Command: "transition", Aliases: []string{"trans"}, - Entry: jiracmd.CmdTransitionRegistry(o, ""), + Entry: jiracmd.CmdTransitionRegistry(""), }, jiracli.CommandRegistry{ Command: "transitions", - Entry: jiracmd.CmdTransitionsRegistry(o, "transitions"), + Entry: jiracmd.CmdTransitionsRegistry("transitions"), }, jiracli.CommandRegistry{ Command: "transmeta", - Entry: jiracmd.CmdTransitionsRegistry(o, "debug"), + Entry: jiracmd.CmdTransitionsRegistry("debug"), }, jiracli.CommandRegistry{ Command: "close", - Entry: jiracmd.CmdTransitionRegistry(o, "close"), + Entry: jiracmd.CmdTransitionRegistry("close"), }, jiracli.CommandRegistry{ Command: "acknowledge", Aliases: []string{"ack"}, - Entry: jiracmd.CmdTransitionRegistry(o, "acknowledge"), + Entry: jiracmd.CmdTransitionRegistry("acknowledge"), }, jiracli.CommandRegistry{ Command: "reopen", - Entry: jiracmd.CmdTransitionRegistry(o, "reopen"), + Entry: jiracmd.CmdTransitionRegistry("reopen"), }, jiracli.CommandRegistry{ Command: "resolve", - Entry: jiracmd.CmdTransitionRegistry(o, "resolve"), + Entry: jiracmd.CmdTransitionRegistry("resolve"), }, jiracli.CommandRegistry{ Command: "start", - Entry: jiracmd.CmdTransitionRegistry(o, "start"), + Entry: jiracmd.CmdTransitionRegistry("start"), }, jiracli.CommandRegistry{ Command: "stop", - Entry: jiracmd.CmdTransitionRegistry(o, "stop"), + Entry: jiracmd.CmdTransitionRegistry("stop"), }, jiracli.CommandRegistry{ Command: "todo", - Entry: jiracmd.CmdTransitionRegistry(o, "To Do"), + Entry: jiracmd.CmdTransitionRegistry("To Do"), }, jiracli.CommandRegistry{ Command: "backlog", - Entry: jiracmd.CmdTransitionRegistry(o, "Backlog"), + Entry: jiracmd.CmdTransitionRegistry("Backlog"), }, jiracli.CommandRegistry{ Command: "done", - Entry: jiracmd.CmdTransitionRegistry(o, "Done"), + Entry: jiracmd.CmdTransitionRegistry("Done"), }, jiracli.CommandRegistry{ Command: "in-progress", Aliases: []string{"prog", "progress"}, - Entry: jiracmd.CmdTransitionRegistry(o, "Progress"), + Entry: jiracmd.CmdTransitionRegistry("Progress"), }, jiracli.CommandRegistry{ Command: "vote", - Entry: jiracmd.CmdVoteRegistry(o), + Entry: jiracmd.CmdVoteRegistry(), }, jiracli.CommandRegistry{ Command: "rank", - Entry: jiracmd.CmdRankRegistry(o), + Entry: jiracmd.CmdRankRegistry(), }, jiracli.CommandRegistry{ Command: "watch", - Entry: jiracmd.CmdWatchRegistry(o), + Entry: jiracmd.CmdWatchRegistry(), }, jiracli.CommandRegistry{ Command: "labels add", - Entry: jiracmd.CmdLabelsAddRegistry(o), + Entry: jiracmd.CmdLabelsAddRegistry(), }, jiracli.CommandRegistry{ Command: "labels set", - Entry: jiracmd.CmdLabelsSetRegistry(o), + Entry: jiracmd.CmdLabelsSetRegistry(), }, jiracli.CommandRegistry{ Command: "labels remove", - Entry: jiracmd.CmdLabelsRemoveRegistry(o), + Entry: jiracmd.CmdLabelsRemoveRegistry(), Aliases: []string{"rm"}, }, jiracli.CommandRegistry{ Command: "take", - Entry: jiracmd.CmdTakeRegistry(o), + Entry: jiracmd.CmdTakeRegistry(), }, jiracli.CommandRegistry{ Command: "assign", - Entry: jiracmd.CmdAssignRegistry(o), + Entry: jiracmd.CmdAssignRegistry(), Aliases: []string{"give"}, }, jiracli.CommandRegistry{ Command: "unassign", - Entry: jiracmd.CmdUnassignRegistry(o), + Entry: jiracmd.CmdUnassignRegistry(), }, jiracli.CommandRegistry{ Command: "component add", - Entry: jiracmd.CmdComponentAddRegistry(o), + Entry: jiracmd.CmdComponentAddRegistry(), }, jiracli.CommandRegistry{ Command: "components", - Entry: jiracmd.CmdComponentsRegistry(o), + Entry: jiracmd.CmdComponentsRegistry(), }, jiracli.CommandRegistry{ Command: "issuetypes", - Entry: jiracmd.CmdIssueTypesRegistry(o), + Entry: jiracmd.CmdIssueTypesRegistry(), }, jiracli.CommandRegistry{ Command: "export-templates", @@ -295,12 +295,12 @@ func main() { }, jiracli.CommandRegistry{ Command: "request", - Entry: jiracmd.CmdRequestRegistry(o), + Entry: jiracmd.CmdRequestRegistry(), Aliases: []string{"req"}, }, } - jiracli.Register(app, fig, registry) + jiracli.Register(app, o, fig, registry) // register custom commands data := struct { diff --git a/jiracli/cli.go b/jiracli/cli.go index 413bb78f..7a8c8b92 100644 --- a/jiracli/cli.go +++ b/jiracli/cli.go @@ -2,9 +2,11 @@ package jiracli import ( "bytes" + "crypto/tls" "fmt" "io" "io/ioutil" + "net/http" "os" "os/exec" "reflect" @@ -12,6 +14,7 @@ import ( "github.com/AlecAivazis/survey" "github.com/coryb/figtree" + "github.com/coryb/oreo" "github.com/jinzhu/copier" shellquote "github.com/kballard/go-shellquote" kingpin "gopkg.in/alecthomas/kingpin.v2" @@ -29,6 +32,8 @@ type GlobalOptions struct { Endpoint figtree.StringOption `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` User figtree.StringOption `json:"user,omitempty" yaml:"user,omitempty"` PasswordSource figtree.StringOption `json:"password-source,omitempty" yaml:"password-source,omitempty"` + UnixProxy figtree.StringOption `yaml:"unixproxy,omitempty" json:"unixproxy,omitempty"` + Insecure figtree.BoolOption `yaml:"insecure,omitempty" json:"insecure,omitempty"` } type CommonOptions struct { @@ -41,7 +46,7 @@ type CommonOptions struct { type CommandRegistryEntry struct { Help string UsageFunc func(*figtree.FigTree, *kingpin.CmdClause) error - ExecuteFunc func(*GlobalOptions) error + ExecuteFunc func(*oreo.Client, *GlobalOptions) error } type CommandRegistry struct { @@ -57,12 +62,30 @@ type kingpinAppOrCommand interface { GetCommand(string) *kingpin.CmdClause } -func Register(app *kingpin.Application, fig *figtree.FigTree, reg []CommandRegistry) { +func Register(app *kingpin.Application, o *oreo.Client, fig *figtree.FigTree, reg []CommandRegistry) { globals := GlobalOptions{ User: figtree.NewStringOption(os.Getenv("USER")), } app.Flag("endpoint", "Base URI to use for Jira").Short('e').SetValue(&globals.Endpoint) app.Flag("user", "Login name used for authentication with Jira service").Short('u').SetValue(&globals.User) + app.Flag("unixproxy", "Path for a unix-socket proxy").SetValue(&globals.UnixProxy) + app.Flag("insecure", "Disable TLS certificate verification").Short('k').SetValue(&globals.Insecure) + + app.PreAction(func(_ *kingpin.ParseContext) error { + if globals.Insecure.Value { + transport := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + } + o = o.WithTransport(transport) + } + if globals.UnixProxy.Value != "" { + o = o.WithTransport(unixProxy(globals.UnixProxy.Value)) + } + return nil + }) for _, command := range reg { copy := command @@ -93,7 +116,7 @@ func Register(app *kingpin.Application, fig *figtree.FigTree, reg []CommandRegis cmd.Action( func(_ *kingpin.ParseContext) error { - return copy.Entry.ExecuteFunc(&globals) + return copy.Entry.ExecuteFunc(o, &globals) }, ) } diff --git a/jiracli/unixproxy.go b/jiracli/unixproxy.go index c0e5b366..dabbd2b3 100644 --- a/jiracli/unixproxy.go +++ b/jiracli/unixproxy.go @@ -8,11 +8,11 @@ import ( "time" ) -type Transport struct { +type transport struct { shadow *http.Transport } -func NewUnixProxyTransport(path string) *Transport { +func newUnixProxyTransport(path string) *transport { dial := func(network, addr string) (net.Conn, error) { return net.Dial("unix", path) } @@ -25,14 +25,14 @@ func NewUnixProxyTransport(path string) *Transport { ExpectContinueTimeout: 10 * time.Second, } - return &Transport{shadow} + return &transport{shadow} } -func UnixProxy(path string) *Transport { - return NewUnixProxyTransport(os.ExpandEnv(path)) +func unixProxy(path string) *transport { + return newUnixProxyTransport(os.ExpandEnv(path)) } -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { req2 := *req url2 := *req.URL req2.URL = &url2 diff --git a/jiracmd/assign.go b/jiracmd/assign.go index 539c4d38..9d106f9f 100644 --- a/jiracmd/assign.go +++ b/jiracmd/assign.go @@ -16,7 +16,7 @@ type AssignOptions struct { Assignee string `yaml:"assignee,omitempty" json:"assignee,omitempty"` } -func CmdAssignRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdAssignRegistry() *jiracli.CommandRegistryEntry { opts := AssignOptions{} return &jiracli.CommandRegistryEntry{ @@ -25,7 +25,7 @@ func CmdAssignRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdAssignUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdAssign(o, globals, &opts) }, } diff --git a/jiracmd/block.go b/jiracmd/block.go index 3d753356..c7f8fab5 100644 --- a/jiracmd/block.go +++ b/jiracmd/block.go @@ -17,7 +17,7 @@ type BlockOptions struct { jiradata.LinkIssueRequest `yaml:",inline" json:",inline" figtree:",inline"` } -func CmdBlockRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdBlockRegistry() *jiracli.CommandRegistryEntry { opts := BlockOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("edit"), @@ -37,7 +37,7 @@ func CmdBlockRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdBlockUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdBlock(o, globals, &opts) }, } diff --git a/jiracmd/browse.go b/jiracmd/browse.go index fe26a763..bff77079 100644 --- a/jiracmd/browse.go +++ b/jiracmd/browse.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/coryb/figtree" + "github.com/coryb/oreo" "github.com/pkg/browser" "gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli" kingpin "gopkg.in/alecthomas/kingpin.v2" @@ -18,7 +19,7 @@ func CmdBrowseRegistry() *jiracli.CommandRegistryEntry { cmd.Arg("ISSUE", "Issue to browse to").Required().StringVar(&issue) return nil }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdBrowse(globals, issue) }, } diff --git a/jiracmd/comment.go b/jiracmd/comment.go index a0ab4a5f..0e256206 100644 --- a/jiracmd/comment.go +++ b/jiracmd/comment.go @@ -18,7 +18,7 @@ type CommentOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdCommentRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdCommentRegistry() *jiracli.CommandRegistryEntry { opts := CommentOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("comment"), @@ -32,7 +32,7 @@ func CmdCommentRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdCommentUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdComment(o, globals, &opts) }, } diff --git a/jiracmd/componentAdd.go b/jiracmd/componentAdd.go index 6ed49a21..755aa05d 100644 --- a/jiracmd/componentAdd.go +++ b/jiracmd/componentAdd.go @@ -17,7 +17,7 @@ type ComponentAddOptions struct { jiradata.Component `yaml:",inline" json:",inline" figtree:",inline"` } -func CmdComponentAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdComponentAddRegistry() *jiracli.CommandRegistryEntry { opts := ComponentAddOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("component-add"), @@ -30,7 +30,7 @@ func CmdComponentAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdComponentAddUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdComponentAdd(o, globals, &opts) }, } diff --git a/jiracmd/components.go b/jiracmd/components.go index 9d66364b..5c322e9a 100644 --- a/jiracmd/components.go +++ b/jiracmd/components.go @@ -16,7 +16,7 @@ type ComponentsOptions struct { Project string `yaml:"project,omitempty" json:"project,omitempty"` } -func CmdComponentsRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdComponentsRegistry() *jiracli.CommandRegistryEntry { opts := ComponentsOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("components"), @@ -29,7 +29,7 @@ func CmdComponentsRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdComponentsUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdComponents(o, globals, &opts) }, } diff --git a/jiracmd/create.go b/jiracmd/create.go index 9fc324f2..b7bf600b 100644 --- a/jiracmd/create.go +++ b/jiracmd/create.go @@ -23,7 +23,7 @@ type CreateOptions struct { SaveFile string `yaml:"savefile,omitempty" json:"savefile,omitempty"` } -func CmdCreateRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdCreateRegistry() *jiracli.CommandRegistryEntry { opts := CreateOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("create"), @@ -37,7 +37,7 @@ func CmdCreateRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdCreateUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdCreate(o, globals, &opts) }, } diff --git a/jiracmd/createmeta.go b/jiracmd/createmeta.go index ea491464..737cda11 100644 --- a/jiracmd/createmeta.go +++ b/jiracmd/createmeta.go @@ -14,7 +14,7 @@ type CreateMetaOptions struct { IssueType string `yaml:"issuetype,omitempty" json:"issuetype,omitempty"` } -func CmdCreateMetaRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdCreateMetaRegistry() *jiracli.CommandRegistryEntry { opts := CreateMetaOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("createmeta"), @@ -27,7 +27,7 @@ func CmdCreateMetaRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdCreateMetaUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdCreateMeta(o, globals, &opts) }, } diff --git a/jiracmd/dup.go b/jiracmd/dup.go index 69d927b3..6bf81449 100644 --- a/jiracmd/dup.go +++ b/jiracmd/dup.go @@ -19,7 +19,7 @@ type DupOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdDupRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdDupRegistry() *jiracli.CommandRegistryEntry { opts := DupOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("edit"), @@ -39,7 +39,7 @@ func CmdDupRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdDupUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdDup(o, globals, &opts) }, } diff --git a/jiracmd/edit.go b/jiracmd/edit.go index 919f8a6d..3f250fa8 100644 --- a/jiracmd/edit.go +++ b/jiracmd/edit.go @@ -20,7 +20,7 @@ type EditOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdEditRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdEditRegistry() *jiracli.CommandRegistryEntry { opts := EditOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("edit"), @@ -34,7 +34,7 @@ func CmdEditRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdEditUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdEdit(o, globals, &opts) }, } diff --git a/jiracmd/editmeta.go b/jiracmd/editmeta.go index cf66b2aa..a45a9ab2 100644 --- a/jiracmd/editmeta.go +++ b/jiracmd/editmeta.go @@ -13,7 +13,7 @@ type EditMetaOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdEditMetaRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdEditMetaRegistry() *jiracli.CommandRegistryEntry { opts := EditMetaOptions{ CommonOptions: jiracli.CommonOptions{ @@ -27,7 +27,7 @@ func CmdEditMetaRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdEditMetaUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdEditMeta(o, globals, &opts) }, } diff --git a/jiracmd/exportTemplates.go b/jiracmd/exportTemplates.go index 08ff8e8c..6fd2e161 100644 --- a/jiracmd/exportTemplates.go +++ b/jiracmd/exportTemplates.go @@ -6,6 +6,7 @@ import ( "path" "github.com/coryb/figtree" + "github.com/coryb/oreo" "gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli" kingpin "gopkg.in/alecthomas/kingpin.v2" ) @@ -27,7 +28,7 @@ func CmdExportTemplatesRegistry() *jiracli.CommandRegistryEntry { } return CmdExportTemplatesUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdExportTemplates(&opts) }, } diff --git a/jiracmd/fields.go b/jiracmd/fields.go index c51e682e..ff4f1496 100644 --- a/jiracmd/fields.go +++ b/jiracmd/fields.go @@ -8,7 +8,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdFieldsRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdFieldsRegistry() *jiracli.CommandRegistryEntry { opts := jiracli.CommonOptions{ Template: figtree.NewStringOption("fields"), } @@ -19,7 +19,7 @@ func CmdFieldsRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.TemplateUsage(cmd, &opts) return nil }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdFields(o, globals, &opts) }, } diff --git a/jiracmd/issuelink.go b/jiracmd/issuelink.go index ac797f49..cfdb7518 100644 --- a/jiracmd/issuelink.go +++ b/jiracmd/issuelink.go @@ -18,7 +18,7 @@ type IssueLinkOptions struct { LinkType string `yaml:"linktype,omitempty" json:"linktype,omitempty"` } -func CmdIssueLinkRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdIssueLinkRegistry() *jiracli.CommandRegistryEntry { opts := IssueLinkOptions{ LinkIssueRequest: jiradata.LinkIssueRequest{ Type: &jiradata.IssueLinkType{}, @@ -32,7 +32,7 @@ func CmdIssueLinkRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdIssueLinkUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdIssueLink(o, globals, &opts) }, } diff --git a/jiracmd/issuelinktypes.go b/jiracmd/issuelinktypes.go index c35ea298..7cfdf450 100644 --- a/jiracmd/issuelinktypes.go +++ b/jiracmd/issuelinktypes.go @@ -8,7 +8,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdIssueLinkTypesRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdIssueLinkTypesRegistry() *jiracli.CommandRegistryEntry { opts := jiracli.CommonOptions{ Template: figtree.NewStringOption("issuelinktypes"), } @@ -19,7 +19,7 @@ func CmdIssueLinkTypesRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdIssueLinkTypesUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdIssueLinkTypes(o, globals, &opts) }, } diff --git a/jiracmd/issuetypes.go b/jiracmd/issuetypes.go index e9b58a41..ea80c4c1 100644 --- a/jiracmd/issuetypes.go +++ b/jiracmd/issuetypes.go @@ -16,7 +16,7 @@ type IssueTypesOptions struct { Project string `yaml:"project,omitempty" json:"project,omitempty"` } -func CmdIssueTypesRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdIssueTypesRegistry() *jiracli.CommandRegistryEntry { opts := IssueTypesOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("issuetypes"), @@ -29,7 +29,7 @@ func CmdIssueTypesRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdIssueTypesUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdIssueTypes(o, globals, &opts) }, } diff --git a/jiracmd/labelsAdd.go b/jiracmd/labelsAdd.go index a4b4b466..8755edbc 100644 --- a/jiracmd/labelsAdd.go +++ b/jiracmd/labelsAdd.go @@ -18,7 +18,7 @@ type LabelsAddOptions struct { Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"` } -func CmdLabelsAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdLabelsAddRegistry() *jiracli.CommandRegistryEntry { opts := LabelsAddOptions{} return &jiracli.CommandRegistryEntry{ "Add labels to an issue", @@ -26,7 +26,7 @@ func CmdLabelsAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdLabelsAddUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdLabelsAdd(o, globals, &opts) }, } diff --git a/jiracmd/labelsRemove.go b/jiracmd/labelsRemove.go index 496b5361..7467b2f0 100644 --- a/jiracmd/labelsRemove.go +++ b/jiracmd/labelsRemove.go @@ -18,7 +18,7 @@ type LabelsRemoveOptions struct { Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"` } -func CmdLabelsRemoveRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdLabelsRemoveRegistry() *jiracli.CommandRegistryEntry { opts := LabelsRemoveOptions{} return &jiracli.CommandRegistryEntry{ "Remove labels from an issue", @@ -26,7 +26,7 @@ func CmdLabelsRemoveRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdLabelsRemoveUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdLabelsRemove(o, globals, &opts) }, } diff --git a/jiracmd/labelsSet.go b/jiracmd/labelsSet.go index 79a34705..ba606b92 100644 --- a/jiracmd/labelsSet.go +++ b/jiracmd/labelsSet.go @@ -18,7 +18,7 @@ type LabelsSetOptions struct { Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"` } -func CmdLabelsSetRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdLabelsSetRegistry() *jiracli.CommandRegistryEntry { opts := LabelsSetOptions{} return &jiracli.CommandRegistryEntry{ "Set labels on an issue", @@ -26,7 +26,7 @@ func CmdLabelsSetRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdLabelsSetUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdLabelsSet(o, globals, &opts) }, } diff --git a/jiracmd/list.go b/jiracmd/list.go index 5b35d6ab..08fa3087 100644 --- a/jiracmd/list.go +++ b/jiracmd/list.go @@ -13,7 +13,7 @@ type ListOptions struct { jira.SearchOptions `yaml:",inline" json:",inline" figtree:",inline"` } -func CmdListRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdListRegistry() *jiracli.CommandRegistryEntry { opts := ListOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("list"), @@ -35,7 +35,7 @@ func CmdListRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { } return CmdListUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdList(o, globals, &opts) }, } diff --git a/jiracmd/login.go b/jiracmd/login.go index 411082cc..bbb2178b 100644 --- a/jiracmd/login.go +++ b/jiracmd/login.go @@ -12,7 +12,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdLoginRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdLoginRegistry() *jiracli.CommandRegistryEntry { opts := jiracli.CommonOptions{} return &jiracli.CommandRegistryEntry{ "Attempt to login into jira server", @@ -20,7 +20,7 @@ func CmdLoginRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return nil }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdLogin(o, globals, &opts) }, } diff --git a/jiracmd/logout.go b/jiracmd/logout.go index c63bc938..d096d3e3 100644 --- a/jiracmd/logout.go +++ b/jiracmd/logout.go @@ -11,7 +11,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdLogoutRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdLogoutRegistry() *jiracli.CommandRegistryEntry { opts := jiracli.CommonOptions{} return &jiracli.CommandRegistryEntry{ "Deactivate sesssion with Jira server", @@ -19,7 +19,7 @@ func CmdLogoutRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return nil }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdLogout(o, globals, &opts) }, } diff --git a/jiracmd/rank.go b/jiracmd/rank.go index 08253d5f..f4fa5c53 100644 --- a/jiracmd/rank.go +++ b/jiracmd/rank.go @@ -19,7 +19,7 @@ type RankOptions struct { Order string `yaml:"order,omitempty" json:"order,omitempty"` } -func CmdRankRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdRankRegistry() *jiracli.CommandRegistryEntry { opts := RankOptions{} return &jiracli.CommandRegistryEntry{ @@ -28,7 +28,7 @@ func CmdRankRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdRankUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdRank(o, globals, &opts) }, } diff --git a/jiracmd/request.go b/jiracmd/request.go index e3742c52..05d8c534 100644 --- a/jiracmd/request.go +++ b/jiracmd/request.go @@ -21,7 +21,7 @@ type RequestOptions struct { Data string `yaml:"data,omitempty" json:"data,omitempty"` } -func CmdRequestRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdRequestRegistry() *jiracli.CommandRegistryEntry { opts := RequestOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("request"), @@ -37,7 +37,7 @@ func CmdRequestRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { } return CmdRequestUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdRequest(o, globals, &opts) }, } diff --git a/jiracmd/subtask.go b/jiracmd/subtask.go index f2939a54..24a10ee1 100644 --- a/jiracmd/subtask.go +++ b/jiracmd/subtask.go @@ -21,7 +21,7 @@ type SubtaskOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdSubtaskRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdSubtaskRegistry() *jiracli.CommandRegistryEntry { opts := SubtaskOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("subtask"), @@ -38,7 +38,7 @@ func CmdSubtaskRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { } return CmdSubtaskUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdSubtask(o, globals, &opts) }, } diff --git a/jiracmd/take.go b/jiracmd/take.go index 6aa9ccea..b1f08a5d 100644 --- a/jiracmd/take.go +++ b/jiracmd/take.go @@ -7,7 +7,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdTakeRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdTakeRegistry() *jiracli.CommandRegistryEntry { opts := AssignOptions{} return &jiracli.CommandRegistryEntry{ @@ -16,7 +16,7 @@ func CmdTakeRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdAssignUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { opts.Assignee = globals.User.Value return CmdAssign(o, globals, &opts) }, diff --git a/jiracmd/transition.go b/jiracmd/transition.go index 114aae7a..3c2689f1 100644 --- a/jiracmd/transition.go +++ b/jiracmd/transition.go @@ -21,7 +21,7 @@ type TransitionOptions struct { Resolution string `yaml:"resolution,omitempty" json:"resolution,omitempty"` } -func CmdTransitionRegistry(o *oreo.Client, transition string) *jiracli.CommandRegistryEntry { +func CmdTransitionRegistry(transition string) *jiracli.CommandRegistryEntry { opts := TransitionOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("transition"), @@ -44,7 +44,7 @@ func CmdTransitionRegistry(o *oreo.Client, transition string) *jiracli.CommandRe } return CmdTransitionUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdTransition(o, globals, &opts) }, } diff --git a/jiracmd/transitions.go b/jiracmd/transitions.go index a68ce7ef..fe76aed3 100644 --- a/jiracmd/transitions.go +++ b/jiracmd/transitions.go @@ -13,7 +13,7 @@ type TransitionsOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdTransitionsRegistry(o *oreo.Client, defaultTemplate string) *jiracli.CommandRegistryEntry { +func CmdTransitionsRegistry(defaultTemplate string) *jiracli.CommandRegistryEntry { opts := TransitionsOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption(defaultTemplate), @@ -26,7 +26,7 @@ func CmdTransitionsRegistry(o *oreo.Client, defaultTemplate string) *jiracli.Com jiracli.LoadConfigs(cmd, fig, &opts) return CmdTransitionsUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdTransitions(o, globals, &opts) }, } diff --git a/jiracmd/unassign.go b/jiracmd/unassign.go index e7243045..a33be49f 100644 --- a/jiracmd/unassign.go +++ b/jiracmd/unassign.go @@ -7,7 +7,7 @@ import ( kingpin "gopkg.in/alecthomas/kingpin.v2" ) -func CmdUnassignRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdUnassignRegistry() *jiracli.CommandRegistryEntry { opts := AssignOptions{} return &jiracli.CommandRegistryEntry{ @@ -16,7 +16,7 @@ func CmdUnassignRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdAssignUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdAssign(o, globals, &opts) }, } diff --git a/jiracmd/unexportTemplates.go b/jiracmd/unexportTemplates.go index 36be6c18..c0023af1 100644 --- a/jiracmd/unexportTemplates.go +++ b/jiracmd/unexportTemplates.go @@ -8,6 +8,7 @@ import ( "path" "github.com/coryb/figtree" + "github.com/coryb/oreo" "gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli" kingpin "gopkg.in/alecthomas/kingpin.v2" ) @@ -25,7 +26,7 @@ func CmdUnexportTemplatesRegistry() *jiracli.CommandRegistryEntry { return CmdExportTemplatesUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdUnexportTemplates(&opts) }, } diff --git a/jiracmd/view.go b/jiracmd/view.go index 348a1ebe..937bed30 100644 --- a/jiracmd/view.go +++ b/jiracmd/view.go @@ -14,7 +14,7 @@ type ViewOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdViewRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdViewRegistry() *jiracli.CommandRegistryEntry { opts := ViewOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("view"), @@ -27,7 +27,7 @@ func CmdViewRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdViewUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdView(o, globals, &opts) }, } diff --git a/jiracmd/vote.go b/jiracmd/vote.go index 39e58d5b..e1b1986f 100644 --- a/jiracmd/vote.go +++ b/jiracmd/vote.go @@ -24,7 +24,7 @@ type VoteOptions struct { Action VoteAction `yaml:"-" json:"-"` } -func CmdVoteRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdVoteRegistry() *jiracli.CommandRegistryEntry { opts := VoteOptions{ CommonOptions: jiracli.CommonOptions{}, Action: VoteUP, @@ -36,7 +36,7 @@ func CmdVoteRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdVoteUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdVote(o, globals, &opts) }, } diff --git a/jiracmd/watch.go b/jiracmd/watch.go index 80b70335..c5acd885 100644 --- a/jiracmd/watch.go +++ b/jiracmd/watch.go @@ -25,7 +25,7 @@ type WatchOptions struct { Action WatchAction `yaml:"-" json:"-"` } -func CmdWatchRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdWatchRegistry() *jiracli.CommandRegistryEntry { opts := WatchOptions{ CommonOptions: jiracli.CommonOptions{}, Action: WatcherAdd, @@ -37,7 +37,7 @@ func CmdWatchRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdWatchUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdWatch(o, globals, &opts) }, } diff --git a/jiracmd/worklogAdd.go b/jiracmd/worklogAdd.go index dce83b7f..835bce47 100644 --- a/jiracmd/worklogAdd.go +++ b/jiracmd/worklogAdd.go @@ -17,7 +17,7 @@ type WorklogAddOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdWorklogAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdWorklogAddRegistry() *jiracli.CommandRegistryEntry { opts := WorklogAddOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("worklog"), @@ -29,7 +29,7 @@ func CmdWorklogAddRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdWorklogAddUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdWorklogAdd(o, globals, &opts) }, } diff --git a/jiracmd/worklogList.go b/jiracmd/worklogList.go index f8c60cc6..0307ed86 100644 --- a/jiracmd/worklogList.go +++ b/jiracmd/worklogList.go @@ -14,7 +14,7 @@ type WorklogListOptions struct { Issue string `yaml:"issue,omitempty" json:"issue,omitempty"` } -func CmdWorklogListRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { +func CmdWorklogListRegistry() *jiracli.CommandRegistryEntry { opts := WorklogListOptions{ CommonOptions: jiracli.CommonOptions{ Template: figtree.NewStringOption("worklogs"), @@ -26,7 +26,7 @@ func CmdWorklogListRegistry(o *oreo.Client) *jiracli.CommandRegistryEntry { jiracli.LoadConfigs(cmd, fig, &opts) return CmdWorklogListUsage(cmd, &opts) }, - func(globals *jiracli.GlobalOptions) error { + func(o *oreo.Client, globals *jiracli.GlobalOptions) error { return CmdWorklogList(o, globals, &opts) }, }