-
Notifications
You must be signed in to change notification settings - Fork 153
/
cmd.go
33 lines (27 loc) · 894 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
package get
import (
"github.com/go-resty/resty/v2"
"github.com/spf13/cobra"
"github.com/weaveworks/weave-gitops/cmd/gitops/get/clusters"
"github.com/weaveworks/weave-gitops/cmd/gitops/get/credentials"
"github.com/weaveworks/weave-gitops/cmd/gitops/get/profiles"
"github.com/weaveworks/weave-gitops/cmd/gitops/get/templates"
)
func GetCommand(endpoint *string, client *resty.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "get",
Short: "Display one or many Weave GitOps resources",
Example: `
# Get all CAPI templates
gitops get templates
# Get all CAPI credentials
gitops get credentials
# Get all CAPI clusters
gitops get clusters`,
}
cmd.AddCommand(templates.TemplateCommand(endpoint, client))
cmd.AddCommand(credentials.CredentialCommand(endpoint, client))
cmd.AddCommand(clusters.ClusterCommand(endpoint, client))
cmd.AddCommand(profiles.Cmd)
return cmd
}