refactor(ipfs2/main) same for debug
Brian Tiger Chow committed
Nov 10, 2014 at 22:26 UTC
2473d2d7206e062309196b6686cb4df90d7d72a2
1 file changed
+6
-4
cmd/ipfs2/main.go
+6
-4
@@ -134,13 +134,15 @@ func handleOptions(req cmds.Request, root *cmds.Command) {
134
exit(0)
135
}
136
137
- if debug, err := req.Option("debug").Bool(); debug && err == nil {
138
- u.Debug = true
139
- u.SetAllLoggers(logging.DEBUG)
140
- } else if err != nil {
137
+ debug, err := req.Option("debug").Bool()
138
+ if err != nil {
139
fmt.Println(err)
140
exit(1)
141
}
142
+ if debug {
143
+ u.Debug = true
144
+ u.SetAllLoggers(logging.DEBUG)
145
+ }
146
}
147
148
func callCommand(req cmds.Request, root *cmds.Command) cmds.Response {