mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 15:06:23 +00:00
added rke --quiet and config --list-version, linting refactor
This commit is contained in:
committed by
Craig Jellick
parent
16a1a5e250
commit
3d73507880
8
main.go
8
main.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/rancher/rke/metadata"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -35,6 +36,9 @@ func mainErr() error {
|
||||
if ctx.GlobalBool("debug") {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
if ctx.GlobalBool("quiet") {
|
||||
logrus.SetOutput(ioutil.Discard)
|
||||
}
|
||||
if released.MatchString(app.Version) {
|
||||
metadata.RKEVersion = app.Version
|
||||
return nil
|
||||
@@ -74,6 +78,10 @@ func mainErr() error {
|
||||
Name: "debug,d",
|
||||
Usage: "Debug logging",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "quiet,q",
|
||||
Usage: "Quiet mode, disables logging and only critical output will be printed",
|
||||
},
|
||||
}
|
||||
return app.Run(os.Args)
|
||||
}
|
||||
|
Reference in New Issue
Block a user