mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
set JIRA_OPERATION when parsing configs. Use figtree config types for options to make defaulting work
This commit is contained in:
+3
-2
@@ -7,6 +7,7 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/coryb/figtree"
|
||||
"github.com/coryb/oreo"
|
||||
|
||||
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
||||
@@ -22,7 +23,7 @@ type RequestOptions struct {
|
||||
func (jc *JiraCli) CmdRequestRegistry() *CommandRegistryEntry {
|
||||
opts := RequestOptions{
|
||||
GlobalOptions: GlobalOptions{
|
||||
Template: "request",
|
||||
Template: figtree.NewStringOption("request"),
|
||||
},
|
||||
Method: "GET",
|
||||
}
|
||||
@@ -85,5 +86,5 @@ func (jc *JiraCli) CmdRequest(opts *RequestOptions) error {
|
||||
return fmt.Errorf("JSON Parse Error: %s from %q", err, content)
|
||||
}
|
||||
|
||||
return jc.runTemplate(opts.Template, &data, nil)
|
||||
return jc.runTemplate(opts.Template.Value, &data, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user