mirror of
https://github.com/spf13/cobra
synced 2024-12-28 23:37:09 +00:00
changed help flag setup to use PersistenFlags so -h will be supported
This commit is contained in:
parent
d8ec18ee74
commit
83b58a2f9b
1 changed files with 1 additions and 1 deletions
|
@ -637,7 +637,7 @@ func (c *Command) Flags() *flag.FlagSet {
|
|||
c.flagErrorBuf = new(bytes.Buffer)
|
||||
}
|
||||
c.flags.SetOutput(c.flagErrorBuf)
|
||||
c.flags.BoolVar(&c.helpFlagVal, "help", false, "help for "+c.Name())
|
||||
c.PersistentFlags().BoolVarP(&c.helpFlagVal, "help", "h", false, "help for "+c.Name())
|
||||
}
|
||||
return c.flags
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue