Add comment for InitDefaultHelpFlag

This commit is contained in:
Albert Nigmatzianov 2017-05-07 10:52:40 +02:00 committed by GitHub
parent fe69f2e3a3
commit d83a1d7ccd

View File

@ -725,6 +725,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
// InitDefaultHelpFlag adds default help flag to c.
// 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() {
c.mergePersistentFlags()
if c.Flags().Lookup("help") == nil {