// Package edgeadmin contains the `edgeadmin` CLI client that can be packaged into Go binaries // e.g., cmd/edge/main.go package edgeadmin import ( "context" "fmt" "os" cfgmanifest "edge-infra.dev/pkg/edge/edgeadmin/commands/cfg" "edge-infra.dev/pkg/edge/edgeadmin/commands/chart" "edge-infra.dev/pkg/edge/edgeadmin/commands/operatorintervention" "edge-infra.dev/pkg/edge/edgeadmin/commands/version" "edge-infra.dev/pkg/edge/edgecli" "edge-infra.dev/pkg/lib/cli/command" ) func NewCmd() (command.Command, error) { cfg, err := edgecli.ReadConfig() if err != nil { return command.Command{}, err } root := command.Command{ ShortUsage: "edgeadmin", Commands: []*command.Command{ cfgmanifest.NewCmd(cfg), operatorintervention.NewCmd(cfg), chart.NewCmd(cfg), version.NewCmd(cfg), }, } return root, nil } func Run(ctx context.Context) error { c, err := NewCmd() if err != nil { fmt.Println("error: failed to instantiate edgeadmin: ", err) return err } if err := c.Command().ParseAndRun(ctx, os.Args[1:]); err != nil { fmt.Println(err) return err } return nil }