Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 3ed3dbe

Browse files
moeryomenkoRadu M
authored andcommitted
refactor root cmd init (#709)
[AddCommand](https://github.com/spf13/cobra/blob/master/command.go#L994) adds one or more commands to this parent command.
1 parent 6f63fe1 commit 3ed3dbe

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

cmd/duffle/root.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,24 @@ func newRootCmd(outputRedirect io.Writer) *cobra.Command {
4141
p.StringVar(&duffleHome, "home", defaultDuffleHome(), "location of your Duffle config. Overrides $DUFFLE_HOME")
4242
p.BoolVarP(&verbose, "verbose", "v", false, "enable verbose output")
4343

44-
cmd.AddCommand(newBuildCmd(outLog))
45-
cmd.AddCommand(newBundleCmd(outLog))
46-
cmd.AddCommand(newInitCmd(outLog))
47-
cmd.AddCommand(newShowCmd(outLog))
48-
cmd.AddCommand(newListCmd(outLog))
49-
cmd.AddCommand(newVersionCmd(outLog))
50-
cmd.AddCommand(newInstallCmd(outLog))
51-
cmd.AddCommand(newStatusCmd(outLog))
52-
cmd.AddCommand(newUninstallCmd(outLog))
53-
cmd.AddCommand(newUpgradeCmd(outLog))
54-
cmd.AddCommand(newRunCmd(outLog))
55-
cmd.AddCommand(newCredentialsCmd(outLog))
56-
cmd.AddCommand(newClaimsCmd(outLog))
57-
cmd.AddCommand(newExportCmd(outLog))
58-
cmd.AddCommand(newImportCmd(outLog))
59-
cmd.AddCommand(newCreateCmd(outLog))
44+
cmd.AddCommand(
45+
newBuildCmd(outLog),
46+
newBundleCmd(outLog),
47+
newInitCmd(outLog),
48+
newShowCmd(outLog),
49+
newListCmd(outLog),
50+
newVersionCmd(outLog),
51+
newInstallCmd(outLog),
52+
newStatusCmd(outLog),
53+
newUninstallCmd(outLog),
54+
newUpgradeCmd(outLog),
55+
newRunCmd(outLog),
56+
newCredentialsCmd(outLog),
57+
newClaimsCmd(outLog),
58+
newExportCmd(outLog),
59+
newImportCmd(outLog),
60+
newCreateCmd(outLog),
61+
)
6062

6163
return cmd
6264
}

0 commit comments

Comments
 (0)