mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
cmd/ipfs: Display help text when help flag is set
This commit is contained in:

committed by
Juan Batiz-Benet

parent
8edfee2a58
commit
063cb536df
@ -50,6 +50,11 @@ func main() {
|
|||||||
os.Exit(1)
|
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) {
|
if debug, found := options.Option("debug"); found && debug.(bool) {
|
||||||
u.Debug = true
|
u.Debug = true
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ var Root = &cmds.Command{
|
|||||||
Options: []cmds.Option{
|
Options: []cmds.Option{
|
||||||
cmds.Option{[]string{"config", "c"}, cmds.String},
|
cmds.Option{[]string{"config", "c"}, cmds.String},
|
||||||
cmds.Option{[]string{"debug", "D"}, cmds.Bool},
|
cmds.Option{[]string{"debug", "D"}, cmds.Bool},
|
||||||
|
cmds.Option{[]string{"help", "h"}, cmds.Bool},
|
||||||
},
|
},
|
||||||
Help: `ipfs - global versioned p2p merkledag file system
|
Help: `ipfs - global versioned p2p merkledag file system
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user