Code to get specs from options

This commit is contained in:
Kovid Goyal
2024-05-11 15:38:44 +05:30
parent 0706c8cf7c
commit 1d6cd27c6f
5 changed files with 128 additions and 14 deletions

View File

@@ -142,6 +142,16 @@ func (self *FamilyList) Lines(num_rows int) []Line {
return ans
}
func (self *FamilyList) SelectFamily(family string) bool {
for i, f := range self.families {
if f == family {
self.current_idx = i
return true
}
}
return false
}
func (self *FamilyList) CurrentFamily() string {
if self.current_idx >= 0 && self.current_idx < len(self.families) {
return self.families[self.current_idx]