-
Notifications
You must be signed in to change notification settings - Fork 75
/
cmd.go
39 lines (32 loc) · 876 Bytes
/
cmd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package config
import (
"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/templates"
"kusionstack.io/kusion/pkg/cmd/config/get"
"kusionstack.io/kusion/pkg/cmd/config/list"
"kusionstack.io/kusion/pkg/cmd/config/set"
"kusionstack.io/kusion/pkg/cmd/config/unset"
"kusionstack.io/kusion/pkg/util/i18n"
)
func NewCmd() *cobra.Command {
var (
short = i18n.T(`Interact with the Kusion config`)
long = i18n.T(`
Config contains the operation of Kusion configurations.`)
)
cmd := &cobra.Command{
Use: "config",
Short: short,
Long: templates.LongDesc(long),
SilenceErrors: true,
RunE: func(cmd *cobra.Command, _ []string) error {
return cmd.Help()
},
}
getCmd := get.NewCmd()
listCmd := list.NewCmd()
setCmd := set.NewCmd()
unsetCmd := unset.NewCmd()
cmd.AddCommand(getCmd, listCmd, setCmd, unsetCmd)
return cmd
}