]> njoseph.me Git - nimcoon.git/blobdiff - nimcoon.nim
Add option to play "all" the search results
[nimcoon.git] / nimcoon.nim
index ae22576213d2131ac10982ef17158c24a54e7346..ed3a572d2d596ced7b0fde6b524db3bf9783029b 100644 (file)
@@ -3,6 +3,7 @@ import
   std/[terminal],
   strutils
 
+import config
 import lib
 
 proc parseOptions(): CommandLineOptions =
@@ -40,7 +41,7 @@ proc main() =
   proc getUserInput(): string =
     if feelingLucky: "0"
     else:
-      presentVideoOptions(searchResults)
+      presentVideoOptions(searchResults[..(limit-1)])
       stdout.styledWrite(fgYellow, "Choose video number: ")
       readLine(stdin)
 
@@ -53,6 +54,11 @@ proc main() =
 
   while(true):
     let userInput = getUserInput()
+
+    if userInput == "all":
+      for number in 0..(len(searchResults)):
+        play(player, buildArgs(number))
+
     if userInput == "q":
       break