1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

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

This commit is contained in:
Matt Bell
2014-10-27 18:52:44 -07:00
committed by Juan Batiz-Benet
parent 8edfee2a58
commit 063cb536df
2 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,11 @@ func main() {
os.Exit(1)
}
if help, found := options.Option("help"); found && help.(bool) {
fmt.Println(cmd.Help)
os.Exit(0)
}
if debug, found := options.Option("debug"); found && debug.(bool) {
u.Debug = true

View File

@ -15,6 +15,7 @@ var Root = &cmds.Command{
Options: []cmds.Option{
cmds.Option{[]string{"config", "c"}, cmds.String},
cmds.Option{[]string{"debug", "D"}, cmds.Bool},
cmds.Option{[]string{"help", "h"}, cmds.Bool},
},
Help: `ipfs - global versioned p2p merkledag file system