This commit is contained in:
Kovid Goyal
2023-08-30 09:36:28 +05:30

View File

@@ -417,12 +417,9 @@ func (self *Command) FindOptions(name_with_hyphens string) []*Option {
depth := 0 depth := 0
for p := self.Parent; p != nil; p = p.Parent { for p := self.Parent; p != nil; p = p.Parent {
depth++ depth++
x := p.FindOptions(name_with_hyphens) for _, po := range p.FindOptions(name_with_hyphens) {
if x != nil { if po.Depth >= depth {
for _, po := range x { ans = append(ans, po)
if po.Depth >= depth {
ans = append(ans, po)
}
} }
} }
} }