diff --git a/cmd/create.go b/cmd/create.go deleted file mode 100644 index 1d619dd0..00000000 --- a/cmd/create.go +++ /dev/null @@ -1 +0,0 @@ -package cmd diff --git a/cmd/install.go b/cmd/install.go new file mode 100644 index 00000000..8c116c8f --- /dev/null +++ b/cmd/install.go @@ -0,0 +1,29 @@ +package cmd + +import ( + "github.com/Mirantis/mcc/pkg/install" + + log "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" +) + +func NewInstallCommand() *cli.Command { + return &cli.Command{ + Name: "install", + Usage: "Install a new cluster", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "config", + Usage: "Path to cluster config yaml", + Aliases: []string{"c"}, + Value: "cluster.yaml", + }, + }, + Action: func(ctx *cli.Context) error { + log.Info("Install called") + + err := install.Install(ctx) + return err + }, + } +} diff --git a/main.go b/main.go index 545e93b9..1e32bfcd 100644 --- a/main.go +++ b/main.go @@ -3,33 +3,13 @@ package main import ( "os" - "github.com/Mirantis/mcc/pkg/install" + "github.com/Mirantis/mcc/cmd" log "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" ) func main() { - installCmd := &cli.Command{ - Name: "install", - Usage: "Install a new cluster", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "config", - Usage: "Path to cluster config yaml", - Aliases: []string{"c"}, - Value: "cluster.yaml", - }, - }, - Action: func(ctx *cli.Context) error { - log.Info("Install called") - log.Debug("Debug is on.....") - - err := install.Install(ctx) - return err - }, - } - app := &cli.App{ Flags: []cli.Flag{ &cli.BoolFlag{ @@ -46,7 +26,7 @@ func main() { return nil }, Commands: []*cli.Command{ - installCmd, + cmd.NewInstallCommand(), }, }