mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Add comment for InitDefaultHelpFlag
This commit is contained in:
parent
fe69f2e3a3
commit
d83a1d7ccd
1 changed files with 1 additions and 0 deletions
|
@ -725,6 +725,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||||
|
|
||||||
// InitDefaultHelpFlag adds default help flag to c.
|
// InitDefaultHelpFlag adds default help flag to c.
|
||||||
// It is called automatically by executing the c or by calling help and usage.
|
// It is called automatically by executing the c or by calling help and usage.
|
||||||
|
// If c already has help flag, it will do nothing.
|
||||||
func (c *Command) InitDefaultHelpFlag() {
|
func (c *Command) InitDefaultHelpFlag() {
|
||||||
c.mergePersistentFlags()
|
c.mergePersistentFlags()
|
||||||
if c.Flags().Lookup("help") == nil {
|
if c.Flags().Lookup("help") == nil {
|
||||||
|
|
Loading…
Reference in a new issue