1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 01:46:55 +00:00
kyverno/cmd/cli/kubectl-kyverno/main.go

29 lines
547 B
Go
Raw Normal View History

2020-03-06 03:00:18 +05:30
package main
import (
"flag"
"fmt"
"os"
2020-03-06 03:00:18 +05:30
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands"
"github.com/kyverno/kyverno/pkg/logging"
"github.com/spf13/cobra"
)
2020-03-06 03:00:18 +05:30
func main() {
cmd := commands.RootCommand()
configureLogs(cmd)
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}
func configureLogs(cli *cobra.Command) {
logging.InitFlags(nil)
if err := logging.Setup(logging.TextFormat, 0); err != nil {
fmt.Println("failed to setup logging", err)
os.Exit(1)
}
cli.PersistentFlags().AddGoFlagSet(flag.CommandLine)
}