Skip to content

Remove code duplication in Command.Run functions. #1072

Closed
1 of 1 issue completed
Closed
@elhimov

Description

@elhimov

The vast range of tt commands have almost indentical Run functions. The only variable part is internal module function (marked with uppercase in below code)

Run: func(cmd *cobra.Command, args []string) {
	cmdCtx.CommandName = cmd.Name()
	err := modules.RunCmd(&cmdCtx, cmd.CommandPath(), &modulesInfo,
		INTERNAL_DOWNLOAD_MODULE, args)
	util.HandleCmdErr(cmd, err)
},

Sub-issues

Metadata

Metadata

Assignees

Labels

code healthImprove code readability, simplify maintenance and so on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions