Commit 1cb94a12 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

cmd/ipfs2: Display subcommand help text on parse error

parent 48c108d5
......@@ -40,10 +40,16 @@ func main() {
}
func createRequest(args []string) (cmds.Request, *cmds.Command) {
req, root, err := cmdsCli.Parse(args, Root, commands.Root)
req, root, cmd, err := cmdsCli.Parse(args, Root, commands.Root)
if err != nil {
fmt.Println(err)
fmt.Println(Root.Help)
if cmd != nil {
if cmd.Help != "" {
fmt.Println(cmd.Help)
}
} else {
fmt.Println(Root.Help)
}
os.Exit(1)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment