Skip to content

Commit cf641bb

Browse files
authored
cmd: Remove --debug flag (#287)
1 parent 7a50e61 commit cf641bb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cmd/root.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
var rootOpts = struct {
1212
context string
13-
debug bool
1413
kubeconfig string
1514
namespace string
1615
}{}
@@ -29,7 +28,6 @@ func newRootCmd(in io.Reader, out io.Writer, args []string) *cobra.Command {
2928
flags := cmd.PersistentFlags()
3029

3130
flags.StringVar(&rootOpts.context, "context", "", "Kubernetes context")
32-
flags.BoolVar(&rootOpts.debug, "debug", false, "Debug mode")
3331
flags.StringVar(&rootOpts.kubeconfig, "kubeconfig", "", "Path of kubeconfig")
3432
flags.StringVarP(&rootOpts.namespace, "namespace", "n", "", "Kubernetes namespace")
3533

@@ -49,11 +47,7 @@ func Execute(in io.Reader, out io.Writer, args []string) {
4947
cmd := newRootCmd(in, out, args)
5048

5149
if err := cmd.Execute(); err != nil {
52-
if rootOpts.debug {
53-
fmt.Printf("%+v\n", err)
54-
} else {
55-
fmt.Println(err)
56-
}
57-
os.Exit(-1)
50+
fmt.Println(err)
51+
os.Exit(1)
5852
}
5953
}

0 commit comments

Comments
 (0)