refactor(ipfs2/main) same for debug

This commit is contained in:
Brian Tiger Chow 2014-11-10 22:26:32 -08:00 committed by Juan Batiz-Benet
parent 28be8a6171
commit 2473d2d720

View File

@ -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 {