...
1 package list
2
3 import (
4 "context"
5 "fmt"
6
7 "edge-infra.dev/pkg/edge/edgecli"
8 "edge-infra.dev/pkg/lib/cli/command"
9 "edge-infra.dev/pkg/lib/cli/rags"
10 )
11
12 func listcluster(cfg *edgecli.Config) *command.Command {
13 var verbose bool
14
15 cmd := &command.Command{
16 ShortUsage: "edge list-contexts cluster",
17 ShortHelp: "Display all stored clusters",
18 Flags: []*rags.Rag{
19 {
20 Name: "verbose",
21 Short: "v",
22 Usage: "Verbose output",
23 Value: &rags.Bool{Var: &verbose},
24 },
25 },
26 Exec: func(_ context.Context, _ []string) error {
27 fmt.Println(cfg.ClusterContextsString(verbose))
28 return nil
29 },
30 }
31
32 return cmd
33 }
34
View as plain text