2017-10-26 00:02:49 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2017-10-29 09:45:21 +00:00
|
|
|
"github.com/rancher/rke/cmd"
|
2017-11-13 21:28:38 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2017-10-26 00:02:49 +00:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
2018-01-15 21:35:31 +00:00
|
|
|
var VERSION = "v0.0.12-dev"
|
2017-10-26 00:02:49 +00:00
|
|
|
|
|
|
|
func main() {
|
2017-11-02 10:07:10 +00:00
|
|
|
if err := mainErr(); err != nil {
|
|
|
|
logrus.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func mainErr() error {
|
2017-10-26 00:02:49 +00:00
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "rke"
|
|
|
|
app.Version = VERSION
|
2017-10-29 09:45:21 +00:00
|
|
|
app.Usage = "Rancher Kubernetes Engine, Running kubernetes cluster in the cloud"
|
|
|
|
app.Before = func(ctx *cli.Context) error {
|
|
|
|
if ctx.GlobalBool("debug") {
|
|
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
|
|
}
|
2017-10-26 00:02:49 +00:00
|
|
|
return nil
|
|
|
|
}
|
2017-10-29 09:45:21 +00:00
|
|
|
app.Author = "Rancher Labs, Inc."
|
|
|
|
app.Email = ""
|
|
|
|
app.Commands = []cli.Command{
|
2017-11-28 11:26:15 +00:00
|
|
|
cmd.UpCommand(),
|
|
|
|
cmd.RemoveCommand(),
|
|
|
|
cmd.VersionCommand(),
|
2017-11-20 22:23:50 +00:00
|
|
|
cmd.ConfigCommand(),
|
2018-05-09 17:39:19 +00:00
|
|
|
cmd.EtcdCommand(),
|
2017-10-29 09:45:21 +00:00
|
|
|
}
|
|
|
|
app.Flags = []cli.Flag{
|
|
|
|
cli.BoolFlag{
|
|
|
|
Name: "debug,d",
|
|
|
|
Usage: "Debug logging",
|
|
|
|
},
|
|
|
|
}
|
2017-11-02 10:07:10 +00:00
|
|
|
return app.Run(os.Args)
|
2017-10-26 00:02:49 +00:00
|
|
|
}
|