Skip to content

Commit

Permalink
cmd: compacter AddCommand calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov authored and salem84 committed Nov 5, 2020
1 parent 3e458c4 commit ab77f70
Showing 1 changed file with 15 additions and 33 deletions.
48 changes: 15 additions & 33 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,40 +151,22 @@ func Execute() {

RootCmd := getRootCmd(ctx, logger, fallbackLogger)

archiveCmd := getArchiveCmd(logger)
RootCmd.AddCommand(archiveCmd)

cloudCmd := getCloudCmd(ctx, logger)
RootCmd.AddCommand(cloudCmd)

RootCmd.AddCommand(getConvertCmd())

inspectCmd := getInspectCmd(logger)
RootCmd.AddCommand(inspectCmd)

loginCmd := getLoginCmd()
RootCmd.AddCommand(loginCmd)

loginCloudCommand := getLoginCloudCommand(logger)
loginCmd.AddCommand(loginCloudCommand)

loginCmd.AddCommand(getLoginInfluxDBCommand(logger))

RootCmd.AddCommand(getPauseCmd(ctx))

RootCmd.AddCommand(getResumeCmd(ctx))

scaleCmd := getScaleCmd(ctx)
RootCmd.AddCommand(scaleCmd)

runCmd := getRunCmd(ctx, logger)
RootCmd.AddCommand(runCmd)

RootCmd.AddCommand(getStatsCmd(ctx))

RootCmd.AddCommand(getStatusCmd(ctx))

RootCmd.AddCommand(getVersionCmd())
loginCmd.AddCommand(getLoginCloudCommand(logger), getLoginInfluxDBCommand(logger))
RootCmd.AddCommand(
getArchiveCmd(logger),
getCloudCmd(ctx, logger),
getConvertCmd(),
getInspectCmd(logger),
loginCmd,
getPauseCmd(ctx),
getResumeCmd(ctx),
getScaleCmd(ctx),
getRunCmd(ctx, logger),
getStatsCmd(ctx),
getStatusCmd(ctx),
getVersionCmd(),
)

if err := RootCmd.Execute(); err != nil {
fields := logrus.Fields{}
Expand Down

0 comments on commit ab77f70

Please sign in to comment.