std/[terminal],
strtabs,
strutils,
+ tables,
uri,
xmltree
type
SearchResult* = tuple[title: string, url: string]
- CommandLineOptions* = tuple[searchQuery: string, musicOnly: bool, feelingLucky: bool, fullScreen: bool]
+ Options* = Table[string, bool]
+ CommandLineOptions* = tuple[searchQuery: string, options: Options]
let processOptions = {poStdErrToStdOut, poUsePath}
map(a => (a.attrs["title"], "https://www.youtube.com" & a.attrs["href"]))
proc presentVideoOptions*(searchResults: seq[SearchResult]) =
- echo ""
+ eraseScreen()
for index, (title, url) in searchResults:
styledEcho $index, ". ", styleBright, fgMagenta, title, "\n", resetStyle, fgCyan, url, "\n"