@cryptotaxi247 / kubo / commits / ad5ad912c

refactor(ipfs2/main) use guard

Brian Tiger Chow committed Nov 10, 2014 at 23:37 UTC ad5ad912ce95f79353eaf0d11e512704d5cc7760
1 file changed +8 -9
cmd/ipfs2/main.go
+8 -9
@@ -148,17 +148,16 @@ func handleHelpOption(req cmds.Request, root *cmds.Command) (helpTextDisplayed b
148 if err != nil {
149 return false, err
150 }
151 -
152 - if help {
153 - helpText, err := cmdsCli.HelpText("ipfs", root, req.Path())
154 - if err != nil {
155 - return false, err
156 - }
157 - fmt.Println(helpText)
158 - return true, nil
151 + if !help {
152 + return false, nil
153 + }
154 + helpText, err := cmdsCli.HelpText("ipfs", root, req.Path())
155 + if err != nil {
156 + return false, err
157 }
158 + fmt.Println(helpText)
159
161 - return false, nil
160 + return true, nil
161 }
162
163 func callCommand(req cmds.Request, root *cmds.Command) (cmds.Response, error) {