kpod: make --debug work
The --debug flag is a global CLI flag, so parse it like one. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
parent
f82fe5691a
commit
05985ff2f7
2 changed files with 7 additions and 5 deletions
|
@ -15,7 +15,6 @@ func main() {
|
|||
if reexec.Init() {
|
||||
return
|
||||
}
|
||||
logrus.SetLevel(logrus.ErrorLevel)
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Name = "kpod"
|
||||
|
@ -44,6 +43,13 @@ func main() {
|
|||
statsCommand,
|
||||
loadCommand,
|
||||
}
|
||||
app.Before = func(c *cli.Context) error {
|
||||
logrus.SetLevel(logrus.ErrorLevel)
|
||||
if c.GlobalBool("debug") {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "config, c",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue