| 267 | } |
| 268 | |
| 269 | func (s *SourceQueryBuilder) Results(dbExecutor db.Executor, verboseSearch SearchVerbosity) error { |
| 270 | for i := range s.results { |
| 271 | if verboseSearch == Minimal { |
| 272 | s.logger.Println(s.results[i].name) |
| 273 | continue |
| 274 | } |
| 275 | |
| 276 | var toPrint string |
| 277 | |
| 278 | if verboseSearch == NumberMenu { |
| 279 | if s.bottomUp { |
| 280 | toPrint += text.Magenta(strconv.Itoa(len(s.results)-i)) + " " |
| 281 | } else { |
| 282 | toPrint += text.Magenta(strconv.Itoa(i+1)) + " " |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | if s.results[i].source == "aur" { |
| 287 | pkg := s.aurQueryMap[s.results[i].name] |
| 288 | toPrint += aurPkgSearchString(pkg, dbExecutor, s.singleLineResults) |
| 289 | } else { |
| 290 | pkg := s.repoQueryMap[s.results[i].source+"/"+s.results[i].name] |
| 291 | toPrint += syncPkgSearchString(pkg, dbExecutor, s.singleLineResults) |
| 292 | } |
| 293 | |
| 294 | s.logger.Println(toPrint) |
| 295 | } |
| 296 | |
| 297 | return nil |
| 298 | } |
| 299 | |
| 300 | func (s *SourceQueryBuilder) Len() int { |
| 301 | return len(s.results) |