tarantool / tarantool/tt

cmd: replace `args` with specific argument(s) in helper functions

Open
#1,075 0 comments 0 reactions 1 assignee View on GitHub

@elhimov is already working on this.

Since Dec 26, 2024.

code health teamE
Dominant language
Go
Stars
113
Forks
18
Avg merge
4d 11h
Merged PRs (30d)
23

Description

Argument args looks natural in command handler functions where its meaning is quite clear. A few examples:

func internalConnectModule(cmdCtx *cmdcontext.CmdCtx, args []string) error
func internalRestartModule(cmdCtx *cmdcontext.CmdCtx, args []string) error

But being used in helper functions, like

func replicasetFillCtx(cmdCtx *cmdcontext.CmdCtx, ctx *replicasetCtx, args []string,
	isRunningCtxRequired bool) error
func resolveConnectOpts(cmdCtx *cmdcontext.CmdCtx, cliOpts *config.CliOpts,
	connectCtx *connect.ConnectCtx, args []string) ...

it turns into a problem, because this kind of functions expect some specific argument(s), not the abstract list of arguments. It makes the code less readable and harder to maintain.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.