Skip to content

Remove code duplication in Command.Run functions. #1072

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
elhimov opened this issue Dec 24, 2024 · 0 comments · Fixed by #1077
Closed

Remove code duplication in Command.Run functions. #1072

elhimov opened this issue Dec 24, 2024 · 0 comments · Fixed by #1077
Assignees
Labels
code health Improve code readability, simplify maintenance and so on

Comments

@elhimov
Copy link
Contributor

elhimov commented Dec 24, 2024

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)
},
@elhimov elhimov added the code health Improve code readability, simplify maintenance and so on label Dec 24, 2024
elhimov added a commit that referenced this issue Dec 25, 2024
elhimov added a commit that referenced this issue Dec 25, 2024
@elhimov elhimov self-assigned this Dec 27, 2024
elhimov added a commit that referenced this issue Dec 27, 2024
elhimov added a commit that referenced this issue Dec 27, 2024
elhimov added a commit that referenced this issue Mar 5, 2025
elhimov added a commit that referenced this issue Mar 7, 2025
elhimov added a commit that referenced this issue Mar 7, 2025
elhimov added a commit that referenced this issue Mar 14, 2025
elhimov added a commit that referenced this issue Mar 14, 2025
elhimov added a commit that referenced this issue Mar 17, 2025
elhimov added a commit that referenced this issue Mar 18, 2025
elhimov added a commit that referenced this issue Mar 18, 2025
elhimov added a commit that referenced this issue Mar 18, 2025
elhimov added a commit that referenced this issue Mar 22, 2025
elhimov added a commit that referenced this issue Mar 28, 2025
elhimov added a commit that referenced this issue Mar 29, 2025
elhimov added a commit that referenced this issue Mar 29, 2025
elhimov added a commit that referenced this issue Apr 1, 2025
elhimov added a commit that referenced this issue Apr 1, 2025
elhimov added a commit that referenced this issue Apr 3, 2025
elhimov added a commit that referenced this issue Apr 3, 2025
dmyger pushed a commit that referenced this issue Apr 3, 2025
dmyger pushed a commit that referenced this issue Apr 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
code health Improve code readability, simplify maintenance and so on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant