mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +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 {
|
||||
if c.Name() == "help" {
|
||||
return nil
|
||||
}
|
||||
|
||||
flags := c.Flags()
|
||||
missingFlagNames := []string{}
|
||||
flags.VisitAll(func(pflag *flag.Flag) {
|
||||
|
|
Loading…
Add table
Reference in a new issue