diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index 3b1512e58..1c3f6a3b3 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -134,13 +134,15 @@ func handleOptions(req cmds.Request, root *cmds.Command) { exit(0) } - if debug, err := req.Option("debug").Bool(); debug && err == nil { - u.Debug = true - u.SetAllLoggers(logging.DEBUG) - } else if err != nil { + debug, err := req.Option("debug").Bool() + if err != nil { fmt.Println(err) exit(1) } + if debug { + u.Debug = true + u.SetAllLoggers(logging.DEBUG) + } } func callCommand(req cmds.Request, root *cmds.Command) cmds.Response {