Various fixes from the completion merge

This commit is contained in:
Kovid Goyal
2022-09-26 11:22:48 +05:30
parent 97716fea8b
commit 262e2fb7a3
8 changed files with 15 additions and 9 deletions

View File

@@ -24,9 +24,9 @@ func (self *CommandGroup) HasVisibleSubCommands() bool {
}
func (self *CommandGroup) Clone(parent *Command) *CommandGroup {
ans := CommandGroup{Title: self.Title, SubCommands: make([]*Command, 0, len(self.SubCommands))}
ans := CommandGroup{Title: self.Title, SubCommands: make([]*Command, len(self.SubCommands))}
for i, o := range self.SubCommands {
self.SubCommands[i] = o.Clone(parent)
ans.SubCommands[i] = o.Clone(parent)
}
return &ans
}