@@ -80,21 +80,21 @@ func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command {
8080 cmd .AddCommand (basecmd .NewDefaultCommandsWithArgs (args , streams )... )
8181 cmd .AddCommand (run )
8282
83- addCommandIfNotNil ( cmd , newInstallCommandWithArgs (args , streams ))
84- addCommandIfNotNil ( cmd , newUninstallCommandWithArgs (args , streams ))
85- addCommandIfNotNil ( cmd , newUpgradeCommandWithArgs (args , streams ))
86- addCommandIfNotNil ( cmd , newEnrollCommandWithArgs (args , streams ))
87- addCommandIfNotNil ( cmd , newInspectCommandWithArgs (args , streams ))
88- addCommandIfNotNil ( cmd , newPrivilegedCommandWithArgs (args , streams ))
89- addCommandIfNotNil ( cmd , newUnprivilegedCommandWithArgs (args , streams ))
90- addCommandIfNotNil ( cmd , newWatchCommandWithArgs (args , streams ))
91- addCommandIfNotNil ( cmd , newContainerCommand (args , streams ))
92- addCommandIfNotNil ( cmd , newStatusCommand (args , streams ))
93- addCommandIfNotNil ( cmd , newDiagnosticsCommand (args , streams ))
94- addCommandIfNotNil ( cmd , newComponentCommandWithArgs (args , streams ))
95- addCommandIfNotNil ( cmd , newLogsCommandWithArgs (args , streams ))
96- addCommandIfNotNil ( cmd , newOtelCommandWithArgs (args , streams ))
97- addCommandIfNotNil ( cmd , newApplyFlavorCommandWithArgs (args , streams ))
83+ cmd . AddCommand ( newInstallCommandWithArgs (args , streams ))
84+ cmd . AddCommand ( newUninstallCommandWithArgs (args , streams ))
85+ cmd . AddCommand ( newUpgradeCommandWithArgs (args , streams ))
86+ cmd . AddCommand ( newEnrollCommandWithArgs (args , streams ))
87+ cmd . AddCommand ( newInspectCommandWithArgs (args , streams ))
88+ cmd . AddCommand ( newPrivilegedCommandWithArgs (args , streams ))
89+ cmd . AddCommand ( newUnprivilegedCommandWithArgs (args , streams ))
90+ cmd . AddCommand ( newWatchCommandWithArgs (args , streams ))
91+ cmd . AddCommand ( newContainerCommand (args , streams ))
92+ cmd . AddCommand ( newStatusCommand (args , streams ))
93+ cmd . AddCommand ( newDiagnosticsCommand (args , streams ))
94+ cmd . AddCommand ( newComponentCommandWithArgs (args , streams ))
95+ cmd . AddCommand ( newLogsCommandWithArgs (args , streams ))
96+ cmd . AddCommand ( newOtelCommandWithArgs (args , streams ))
97+ cmd . AddCommand ( newApplyFlavorCommandWithArgs (args , streams ))
9898
9999 // windows special hidden sub-command (only added on Windows)
100100 reexec := newReExecWindowsCommand (args , streams )
@@ -106,11 +106,3 @@ func NewCommandWithArgs(args []string, streams *cli.IOStreams) *cobra.Command {
106106
107107 return cmd
108108}
109-
110- func addCommandIfNotNil (parent , cmd * cobra.Command ) {
111- if cmd == nil || parent == nil {
112- return
113- }
114-
115- parent .AddCommand (cmd )
116- }
0 commit comments