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,10 +500,10 @@ func (c *Command) SuggestFunc(typedName string) string {
|
||||||
if parent.suggestFunc != nil {
|
if parent.suggestFunc != nil {
|
||||||
return parent.suggestFunc
|
return parent.suggestFunc
|
||||||
}
|
}
|
||||||
if parent.HasParent() {
|
if !parent.HasParent() {
|
||||||
return getParentFunc(parent.Parent())
|
return nil
|
||||||
}
|
}
|
||||||
return nil
|
return getParentFunc(parent.Parent())
|
||||||
}
|
}
|
||||||
parentFunc := getParentFunc(c.Parent())
|
parentFunc := getParentFunc(c.Parent())
|
||||||
if parentFunc != nil {
|
if parentFunc != nil {
|
||||||
|
|
Loading…
Reference in a new issue