From 2473d2d7206e062309196b6686cb4df90d7d72a2 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Mon, 10 Nov 2014 22:26:32 -0800 Subject: [PATCH] refactor(ipfs2/main) same for debug --- cmd/ipfs2/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 {