airshipctl/cmd/config/config.go
Ian H. Pittwood c7c1011a5c Fix various code style issues
Fixes possible name collisions between variable names and package names

Remove redundant import naming

Use nil slices for slice declarations instead of empty slices

Use make for slices of fixed lengths

Remove redundant parentheses

Replace deprecated `SetOutput` method with `SetOut`

Fix swapped actual/expected arguments on assertEqualGolden

Change-Id: Ia39ef44372c3e44948e5440575125bdb470898df
2020-02-07 09:28:18 -06:00

28 lines
1.0 KiB
Go

package config
import (
"github.com/spf13/cobra"
"opendev.org/airship/airshipctl/pkg/environment"
)
// NewConfigCommand creates a command object for the airshipctl "config" , and adds all child commands to it.
func NewConfigCommand(rootSettings *environment.AirshipCTLSettings) *cobra.Command {
configRootCmd := &cobra.Command{
Use: "config",
DisableFlagsInUseLine: true,
Short: "Modify airshipctl config files",
Long: `Modify airshipctl config files using subcommands
like "airshipctl config set-context --current-context my-context" `,
}
configRootCmd.AddCommand(NewCmdConfigSetCluster(rootSettings))
configRootCmd.AddCommand(NewCmdConfigGetCluster(rootSettings))
configRootCmd.AddCommand(NewCmdConfigSetContext(rootSettings))
configRootCmd.AddCommand(NewCmdConfigGetContext(rootSettings))
configRootCmd.AddCommand(NewCmdConfigInit(rootSettings))
configRootCmd.AddCommand(NewCmdConfigSetAuthInfo(rootSettings))
configRootCmd.AddCommand(NewCmdConfigGetAuthInfo(rootSettings))
return configRootCmd
}