mirror of
https://github.com/spf13/cobra
synced 2025-05-06 13:27:26 +00:00
Return nil error in validateRequiredFlags when help command
This commit is contained in:
parent
67fc4837d2
commit
97032908c6
1 changed files with 4 additions and 0 deletions
|
@ -879,6 +879,10 @@ func (c *Command) ValidateArgs(args []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Command) validateRequiredFlags() error {
|
func (c *Command) validateRequiredFlags() error {
|
||||||
|
if c.Name() == "help" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
flags := c.Flags()
|
flags := c.Flags()
|
||||||
missingFlagNames := []string{}
|
missingFlagNames := []string{}
|
||||||
flags.VisitAll(func(pflag *flag.Flag) {
|
flags.VisitAll(func(pflag *flag.Flag) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue