From ab77f707b0d61e7c456e3562381344dd67c71490 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Mon, 2 Nov 2020 11:33:13 +0200 Subject: [PATCH] cmd: compacter AddCommand calls --- cmd/root.go | 48 +++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index d0f364ff7ed5..b7e25b5561d7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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{}