mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-19 04:33:28 +02:00
refactor for GlobalOptions and CommonOptions
This commit is contained in:
@@ -15,21 +15,21 @@ type ExportTemplatesOptions struct {
|
||||
Dir string `yaml:"dir,omitempty" json:"dir,omitempty"`
|
||||
}
|
||||
|
||||
func CmdExportTemplatesRegistry(fig *figtree.FigTree) *jiracli.CommandRegistryEntry {
|
||||
func CmdExportTemplatesRegistry() *jiracli.CommandRegistryEntry {
|
||||
opts := ExportTemplatesOptions{}
|
||||
|
||||
return &jiracli.CommandRegistryEntry{
|
||||
"Export templates for customizations",
|
||||
func() error {
|
||||
return CmdExportTemplates(&opts)
|
||||
},
|
||||
func(cmd *kingpin.CmdClause) error {
|
||||
func(fig *figtree.FigTree, cmd *kingpin.CmdClause) error {
|
||||
jiracli.LoadConfigs(cmd, fig, &opts)
|
||||
if opts.Dir == "" {
|
||||
opts.Dir = fmt.Sprintf("%s/.jira.d/templates", jiracli.Homedir())
|
||||
}
|
||||
return CmdExportTemplatesUsage(cmd, &opts)
|
||||
},
|
||||
func(globals *jiracli.GlobalOptions) error {
|
||||
return CmdExportTemplates(&opts)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user