@cryptotaxi247 / kubo / commits / 063cb536d

cmd/ipfs: Display help text when help flag is set

Matt Bell committed Oct 27, 2014 at 18:52 UTC 063cb536df86a0fde304478d97d12b263cd6a132
2 files changed +6
cmd/ipfs/ipfs.go
+5
@@ -50,6 +50,11 @@ func main() {
50 os.Exit(1)
51 }
52
53 + if help, found := options.Option("help"); found && help.(bool) {
54 + fmt.Println(cmd.Help)
55 + os.Exit(0)
56 + }
57 +
58 if debug, found := options.Option("debug"); found && debug.(bool) {
59 u.Debug = true
60
core/commands/root.go
+1
@@ -15,6 +15,7 @@ var Root = &cmds.Command{
15 Options: []cmds.Option{
16 cmds.Option{[]string{"config", "c"}, cmds.String},
17 cmds.Option{[]string{"debug", "D"}, cmds.Bool},
18 + cmds.Option{[]string{"help", "h"}, cmds.Bool},
19 },
20 Help: `ipfs - global versioned p2p merkledag file system
21