1
0
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:
Luther Monson
2019-08-23 12:51:34 -07:00
committed by Craig Jellick
parent 16a1a5e250
commit 3d73507880
3 changed files with 64 additions and 24 deletions

View File

@@ -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)
}