зеркало из https://github.com/microsoft/oe-engine.git
39 строки
820 B
Go
39 строки
820 B
Go
package cmd
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const (
|
|
rootName = "oe-engine"
|
|
rootShortDescription = "OE-Engine deploys and manages ACC clusters in Azure"
|
|
rootLongDescription = "OE-Engine deploys and manages ACC clusters in Azure"
|
|
)
|
|
|
|
var (
|
|
debug bool
|
|
)
|
|
|
|
// NewRootCmd returns the root command for OE engine.
|
|
func NewRootCmd() *cobra.Command {
|
|
rootCmd := &cobra.Command{
|
|
Use: rootName,
|
|
Short: rootShortDescription,
|
|
Long: rootLongDescription,
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
if debug {
|
|
log.SetLevel(log.DebugLevel)
|
|
}
|
|
},
|
|
}
|
|
|
|
p := rootCmd.PersistentFlags()
|
|
p.BoolVar(&debug, "debug", false, "enable verbose debug logs")
|
|
|
|
rootCmd.AddCommand(newVersionCmd())
|
|
rootCmd.AddCommand(newGenerateCmd())
|
|
|
|
return rootCmd
|
|
}
|