INNER CODE UNIT · Go
main
easegress-io/easegress · cmd/client/main.go:53
func main() {
rootCmd := &cobra.Command{
Use: "egctl",
Short: "A command line admin tool for Easegress.",
SuggestFor: []string{"egctl"},
PersistentPreRun: func(cmd *cobra.Command, args []string) {
switch general.CmdGlobalFlags.OutputFormat {
case "yaml", "json", "default":
default:
general.ExitWithErrorf("unsupported output format: %s, only support (yaml, json and default)",
general.CmdGlobalFlags.OutputFormat)
}
},
}
addCommandWithGroup := func(group *cobra.Group, cmd ...*cobra.Command) {
for _, c := range cmd {
c.GroupID = group.ID