/
create.go
30 lines (28 loc) · 931 Bytes
/
create.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
package create
import (
"github.com/loft-sh/api/v3/pkg/product"
"github.com/loft-sh/loftctl/v3/cmd/loftctl/flags"
pdefaults "github.com/loft-sh/loftctl/v3/pkg/defaults"
"github.com/loft-sh/loftctl/v3/pkg/upgrade"
"github.com/spf13/cobra"
)
// NewCreateCmd creates a new cobra command
func NewCreateCmd(globalFlags *flags.GlobalFlags, defaults *pdefaults.Defaults) *cobra.Command {
description := product.ReplaceWithHeader("create", "")
if upgrade.IsPlugin == "true" {
description = `
#######################################################
##################### loft create #####################
#######################################################
`
}
c := &cobra.Command{
Use: "create",
Short: product.Replace("Creates loft resources"),
Long: description,
Args: cobra.NoArgs,
}
c.AddCommand(NewSpaceCmd(globalFlags, defaults))
c.AddCommand(NewVirtualClusterCmd(globalFlags, defaults))
return c
}