From f4f7f34c57245cca374ded2af030aec25ddea351 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Thu, 22 Nov 2018 21:20:39 +0100 Subject: [PATCH] feat(cmd): root command --- cmd/root.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cmd/root.go diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 00000000..509cf41b --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "github.com/fntlnz/kubectl-trace/pkg/cmd" + "github.com/spf13/pflag" + "k8s.io/cli-runtime/pkg/genericclioptions" +) + +func main() { + flags := pflag.NewFlagSet("kubectl-trace", pflag.ExitOnError) + pflag.CommandLine = flags + + streams := genericclioptions.IOStreams{ + In: os.Stdin, + Out: os.Stdout, + ErrOut: os.Stderr, + } + root := cmd.NewTraceCommand(streams) + if err := root.Execute(); err != nil { + os.Exit(1) + } +}