mirror of
https://github.com/spf13/cobra
synced 2025-05-05 04:47:22 +00:00
add --version to the list of flags returned
This commit is contained in:
parent
5b11656e45
commit
48197dead4
1 changed files with 2 additions and 1 deletions
|
@ -1120,7 +1120,8 @@ Simply type ` + c.Name() + ` help [path to command] for full details.`,
|
||||||
c.Printf("Unknown help topic %#q\n", args)
|
c.Printf("Unknown help topic %#q\n", args)
|
||||||
CheckErr(c.Root().Usage())
|
CheckErr(c.Root().Usage())
|
||||||
} else {
|
} else {
|
||||||
cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
|
cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
|
||||||
|
cmd.InitDefaultVersionFlag() // make possible 'version' flag to be shown
|
||||||
CheckErr(cmd.Help())
|
CheckErr(cmd.Help())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue