-
Notifications
You must be signed in to change notification settings - Fork 13
/
cmd.go
28 lines (22 loc) · 999 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
// Copyright Contributors to the Open Cluster Management project
package clusterset
import (
"fmt"
genericclioptionscm "github.com/stolostron/cm-cli/pkg/genericclioptions"
clusteradmbind "open-cluster-management.io/clusteradm/pkg/cmd/clusterset/bind"
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
var example = `
# Bind a clusterset to a namespace
%[1]s bind clusterset clusterset1 --namespace default
`
// NewCmd provides a cobra command wrapping NewCmdImportCluster
func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, cmFlags *genericclioptionscm.CMFlags, streams genericclioptions.IOStreams) *cobra.Command {
cmd := clusteradmbind.NewCmd(clusteradmFlags, streams)
cmd.Use = "clusterset"
cmd.Example = fmt.Sprintf(example, clusteradmhelpers.GetExampleHeader())
return cmd
}