mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
Allow un-ambiguous prefixes for command names
This commit is contained in:
@@ -48,6 +48,15 @@ func (self *CommandGroup) FindSubCommand(name string) *Command {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CommandGroup) FindSubCommands(prefix string, matches []*Command) []*Command {
|
||||
for _, c := range self.SubCommands {
|
||||
if strings.HasPrefix(c.Name, prefix) {
|
||||
matches = append(matches, c)
|
||||
}
|
||||
}
|
||||
return matches
|
||||
}
|
||||
|
||||
type OptionGroup struct {
|
||||
Options []*Option
|
||||
Title string
|
||||
|
||||
Reference in New Issue
Block a user