mirror of
https://github.com/spf13/cobra
synced 2025-01-30 15:36:47 +00:00
Switch condition and returns.
This commit is contained in:
parent
90335672a9
commit
4d65edfb54
1 changed files with 3 additions and 3 deletions
|
@ -500,11 +500,11 @@ func (c *Command) SuggestFunc(typedName string) string {
|
|||
if parent.suggestFunc != nil {
|
||||
return parent.suggestFunc
|
||||
}
|
||||
if parent.HasParent() {
|
||||
return getParentFunc(parent.Parent())
|
||||
}
|
||||
if !parent.HasParent() {
|
||||
return nil
|
||||
}
|
||||
return getParentFunc(parent.Parent())
|
||||
}
|
||||
parentFunc := getParentFunc(c.Parent())
|
||||
if parentFunc != nil {
|
||||
return parentFunc(typedName)
|
||||
|
|
Loading…
Reference in a new issue