Add comment for InitDefaultHelpFlag
This commit is contained in:
parent
fe69f2e3a3
commit
d83a1d7ccd
@ -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 New Issue
Block a user