mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-06 04:58:30 +02:00
rewrite checkpoint
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package jiracli
|
||||
|
||||
import kingpin "gopkg.in/alecthomas/kingpin.v2"
|
||||
|
||||
func (jc *JiraCli) CmdFieldsRegistry() *CommandRegistryEntry {
|
||||
opts := GlobalOptions{
|
||||
Template: "fields",
|
||||
}
|
||||
return &CommandRegistryEntry{
|
||||
"Prints all fields, both System and Custom",
|
||||
func() error {
|
||||
return jc.CmdFields(&opts)
|
||||
},
|
||||
func(cmd *kingpin.CmdClause) error {
|
||||
err := jc.GlobalUsage(cmd, &opts)
|
||||
jc.TemplateUsage(cmd, &opts)
|
||||
return err
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Fields will send data from /rest/api/2/field API to "fields" template
|
||||
func (jc *JiraCli) CmdFields(opts *GlobalOptions) error {
|
||||
data, err := jc.GetFields()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return jc.runTemplate(opts.Template, data, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user